src/Sulu/Bundle/MediaBundle/Controller/CollectionController.php
public function deleteAction($id)
    {
        $delete = function($id) {
            try {
                $collectionManager = $this->getCollectionManager();
                $collectionManager->delete($id);
            } catch (CollectionNotFoundException $cnf) {
                throw new EntityNotFoundException(self::$entityName, $id); // will throw 404 Entity not found
            } catch (MediaException $me) {
                throw new RestException($me->getMessage(), $me->getCode()); // will throw 400 Bad Request
            }
        };

        $view = $this->responseDelete($id, $delete);

        return $this->handleView($view);
    }
public function deleteAction($id)
    {
        $delete = function($id) {
            try {
                $collectionManager = $this->getCollectionManager();
                $collectionManager->delete($id);
            } catch (CollectionNotFoundException $cnf) {
                throw new EntityNotFoundException(self::$entityName, $id); // will throw 404 Entity not found
            } catch (MediaException $me) {
                throw new RestException($me->getMessage(), $me->getCode()); // will throw 400 Bad Request
            }
        };

        $view = $this->responseDelete($id, $delete);

        return $this->handleView($view);
    }
public function deleteAction ( $ id ) { $ delete = function ( $ id ) { try { $ collectionManager = $ this -> getCollectionManager ( ) ; $ collectionManager -> delete ( $ id ) ; } catch ( CollectionNotFoundException $ cnf ) { throw new EntityNotFoundException ( self :: $ entityName , $ id ) ; // will throw 404 Entity not found } catch ( MediaException $ me ) { throw new RestException ( $ me -> getMessage ( ) , $ me -> getCode ( ) ) ; // will throw 400 Bad Request } } ; $ view = $ this -> responseDelete ( $ id , $ delete ) ; return $ this -> handleView ( $ view ) ; }
Delete a collection with the given id.

@param $id

@return \Symfony\Component\HttpFoundation\Response
Delete a collection with the given id .