Neos.Media.Browser/Classes/Controller/AssetController.php
public function deleteAction(Asset $asset): void
    {
        $usageReferences = $this->assetService->getUsageReferences($asset);
        if (count($usageReferences) > 0) {
            $this->addFlashMessage('deleteRelatedNodes', '', Message::SEVERITY_WARNING, [], 1412422767);
            $this->redirect('index');
        }

        $this->assetRepository->remove($asset);
        $this->addFlashMessage('assetHasBeenDeleted', '', Message::SEVERITY_OK, [$asset->getLabel()], 1412375050);
        $this->redirect('index');
    }
public function deleteAction(Asset $asset): void
    {
        $usageReferences = $this->assetService->getUsageReferences($asset);
        if (count($usageReferences) > 0) {
            $this->addFlashMessage('deleteRelatedNodes', '', Message::SEVERITY_WARNING, [], 1412422767);
            $this->redirect('index');
        }

        $this->assetRepository->remove($asset);
        $this->addFlashMessage('assetHasBeenDeleted', '', Message::SEVERITY_OK, [$asset->getLabel()], 1412375050);
        $this->redirect('index');
    }
public function deleteAction ( Asset $ asset ) : void { $ usageReferences = $ this -> assetService -> getUsageReferences ( $ asset ) ; if ( count ( $ usageReferences ) > 0 ) { $ this -> addFlashMessage ( 'deleteRelatedNodes' , '' , Message :: SEVERITY_WARNING , [ ] , 1412422767 ) ; $ this -> redirect ( 'index' ) ; } $ this -> assetRepository -> remove ( $ asset ) ; $ this -> addFlashMessage ( 'assetHasBeenDeleted' , '' , Message :: SEVERITY_OK , [ $ asset -> getLabel ( ) ] , 1412375050 ) ; $ this -> redirect ( 'index' ) ; }
Delete an asset

@param Asset $asset
@return void
@throws IllegalObjectTypeException
@throws StopActionException
@throws AssetServiceException
Delete an asset