protected function destroy( ValueObject $object )
    {
         /** @var \eZ\Publish\API\Repository\Repository $repository */
        $repository = $this->getRepository();
        $contentId = $object->id;
        $repository->sudo(
            function() use( $repository, $contentId )
            {
                try
                {
                    $contentService = $repository->getContentService();
                    $contentInfo = $contentService->loadContentInfo( $contentId );
                    $contentService->deleteContent( $contentInfo );
                }
                catch ( ApiExceptions\NotFoundException $e )
                {
                    // Nothing to do
                }
            }
        );
    }
protected function destroy( ValueObject $object )
    {
         /** @var \eZ\Publish\API\Repository\Repository $repository */
        $repository = $this->getRepository();
        $contentId = $object->id;
        $repository->sudo(
            function() use( $repository, $contentId )
            {
                try
                {
                    $contentService = $repository->getContentService();
                    $contentInfo = $contentService->loadContentInfo( $contentId );
                    $contentService->deleteContent( $contentInfo );
                }
                catch ( ApiExceptions\NotFoundException $e )
                {
                    // Nothing to do
                }
            }
        );
    }
protected function destroy ( ValueObject $ object ) { /** @var \eZ\Publish\API\Repository\Repository $repository */ $ repository = $ this -> getRepository ( ) ; $ contentId = $ object -> id ; $ repository -> sudo ( function ( ) use ( $ repository , $ contentId ) { try { $ contentService = $ repository -> getContentService ( ) ; $ contentInfo = $ contentService -> loadContentInfo ( $ contentId ) ; $ contentService -> deleteContent ( $ contentInfo ) ; } catch ( ApiExceptions \ NotFoundException $ e ) { // Nothing to do } } ) ; }
Deletes the content object provided
used to clean after testing
Deletes the content object provided used to clean after testing