Get Content Trash service.

Trash service allows to perform operations related to location trash
(trash/untrash, load/list from trash...)

@return \eZ\Publish\API\Repository\TrashService
549592
public function getTrashService()
    {
        if ($this->trashService !== null) {
            return $this->trashService;
        }

        $this->trashService = new TrashService(
            $this,
            $this->persistenceHandler,
            $this->getNameSchemaService(),
            $this->getPermissionCriterionResolver(),
            $this->serviceSettings['trash']
        );

        return $this->trashService;
    }
732441
public function emptyAction(Request $request): Response
    {
        if (!$this->isGranted(new Attribute('content', 'cleantrash'))) {
            return $this->redirect($this->generateUrl('ezplatform.trash.list'));
        }

        $form = $this->formFactory->emptyTrash(
            new TrashEmptyData(true)
        );
        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function () {
                $this->trashService->emptyTrash();

                $this->notificationHandler->success(
                    $this->translator->trans(
                        /** @Desc("Trash empty.") */
                        'trash.empty.success',
                        [],
                        'trash'
                    )
                );

                return new RedirectResponse($this->generateUrl('ezplatform.trash.list'));
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        return $this->redirect($this->generateUrl('ezplatform.trash.list'));
    }
103501
public function getSectionService()
    {
        if ($this->sectionService !== null) {
            return $this->sectionService;
        }

        $this->sectionService = new SectionService(
            $this,
            $this->persistenceHandler->sectionHandler(),
            $this->persistenceHandler->locationHandler(),
            $this->getPermissionCriterionResolver(),
            $this->serviceSettings['section']
        );

        return $this->sectionService;
    }
40268
public function getURLAliasService()
    {
        if (null === $this->urlAliasService) {
            $this->urlAliasService = new URLAliasService(
                $this->client,
                $this->inputDispatcher,
                $this->outputVisitor,
                $this->requestParser
            );
        }

        return $this->urlAliasService;
    }
344583
public function getURLService()
    {
        if ($this->urlService !== null) {
            return $this->urlService;
        }

        $this->urlService = new URLService(
            $this,
            $this->persistenceHandler->urlHandler()
        );

        return $this->urlService;
    }
206542
public function getFile()
    {
        if (null === $this->file) {
            unlink($this->file = tempnam(sys_get_temp_dir(), 'upd'));
            mkdir($this->file);

            $this->file .= DIRECTORY_SEPARATOR . $this->name;

            $in = new SplFileObject($this->url, 'rb', false);
            $out = new SplFileObject($this->file, 'wb', false);

            while (false === $in->eof()) {
                $out->fwrite($in->fgets());
            }

            unset($in, $out);

            if ($this->publicKey) {
                $in = new SplFileObject($this->publicKey, 'r', false);
                $out = new SplFileObject($this->file . '.pubkey', 'w', false);

                while (false === $in->eof()) {
                    $out->fwrite($in->fgets());
                }

                unset($in, $out);
            }

            if ($this->sha1 !== ($sha1 = sha1_file($this->file))) {
                $this->deleteFile();

                throw FileException::create(
                    'Mismatch of the SHA1 checksum (%s) of the downloaded file (%s).',
                    $this->sha1,
                    $sha1
                );
            }

            // double check
            try {
                new Phar($this->file);
            } catch (UnexpectedValueException $exception) {
                $this->deleteFile();

                throw $exception;
            }
        }

        return $this->file;
    }
458579
protected function getSoap()
    {
        if ($this->SOAPClient === null) {
            $this->SOAPClient = new \SoapClient($this->url,
                [
                    'trace' => 1,
                    'cache_wsdl' => WSDL_CACHE_NONE
                ]);
            if ($this->location) {
                $this->SOAPClient->__setLocation($this->location);
            }
        }
        return $this->SOAPClient;
    }
217994
public function getContent()
    {
        $content = $this->getRawContent();
        $content = apply_filters('the_content', $content);
        $content = str_replace( ']]>', ']]&gt;', $content);

        return $content;
    }
383992
public function getCustomServiceKFlist(){
        if (!$this->access_token && !$this->checkAuth()) return false;
        $result = $this->http_get(self::API_URL_PREFIX.self::CUSTOM_SERVICE_GET_KFLIST.'access_token='.$this->access_token);
        if ($result)
        {
            $json = json_decode($result,true);
            if (!$json || !empty($json['errcode'])) {
                $this->errCode = $json['errcode'];
                $this->errMsg = $json['errmsg'];
                return false;
            }
            return $json;
        }
        return false;
    }
139589
function getAverageRating()
    {
        $avgRating = ezsrRatingObject::fetchByObjectId( $this->attribute('contentobject_id'), $this->attribute('contentobject_attribute_id') );
        if ( !$avgRating instanceof ezsrRatingObject )
        {
            $avgRating = ezsrRatingObject::create( array('contentobject_id' => $this->attribute('contentobject_id'),
                                                         'contentobject_attribute_id' => $this->attribute('contentobject_attribute_id') ) );
        }
        return $avgRating;
    }
231055
protected function getCleanContent()
    {
        $content = var_export($this->content, true);

        # Replace the array openers with square brackets
        $content = preg_replace('#^(\s*)array\s*\(#i', '\\1[', $content);
        $content = preg_replace('#=>(\s*)array\s*\(#is', '=> [', $content);

        # Replace the array closers with square brackets
        $content = preg_replace('#^(\s*)\),#im', '\\1],', $content);
        $content = substr($content, 0, -1) . ']';

        // Remove integer indexes for unassociative array lists
        $content = preg_replace('#(\s*)\d+\s*=>\s*(.*)#i', '\\1\\2', $content);

        $content = $this->replaceDoubleSpaceIndentWithCustomSpaceIndent($content);

        return $content;
    }
768232
public function getContentTypeService()
    {
        if (null === $this->contentTypeService) {
            $this->contentTypeService = new ContentTypeService(
                $this->client,
                $this->inputDispatcher,
                $this->outputVisitor,
                $this->requestParser
            );
        }

        return $this->contentTypeService;
    }
887806
private function getCachedContent()
    {
        $item = null;

        if (null !== $this->cache) {
            $item = $this->cache->getItem($this->cacheKey);
            $cacheContent = $item->get();

            if ($item->isHit() && null !== $cacheContent) {
                $this->contentCache = $cacheContent;
            }
        }

        return $item;
    }
183452
public function getContent()
    {
        if ($this->_oContent === null) {
            $this->_oContent = false;
            if ($this->getContentId()) {
                return $this->_oContent;
            }
        }

        return $this->_oContent;
    }
1261920
public function getContent()
    {
        if ($this->content === null) {
            fseek($this->stream, 0);
            while (($buf = $this->read()) !== false) {
                $this->content .= $buf;
            }
        }

        return $this->content;
    }
1235548
public function trashAction()
    {
        /** @var \Doctrine\ORM\EntityManager $em */
        $em = $this->get('doctrine.orm.entity_manager');

        return $this->render('CMSBundle:AdminStructure:trash.html.twig', [
            'deleted_folders' => $em->getRepository(Folder::class)->findDeleted(),
            'deleted_nodes'   => $em->getRepository(Node::class)->findDeleted(),
        ]);
    }
558763
public function getClear()
    {
        $return = str_replace(self::$namespacePrefix . '/', '', $this->name);
        $exists = array_where(self::$core, function($key) use($return) {
            return $return == $key;
        });
        if (!empty($exists)) {
            return self::$registeredForCore;
        }
        if ($return == 'app') {
            return 'content';
        }

        $name = ($return == 'app') ? self::frontendContentComponent : $return;

        return str_replace('antaresproject/', '', $name);
    }