Sulu\Bundle\MediaBundle\Controller\CollectionController::deleteAction PHP Method

deleteAction() public method

Delete a collection with the given id.
public deleteAction ( $id ) : Response
$id
return Symfony\Component\HttpFoundation\Response
    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);
    }