public function deleteAction($type, $uid)
    {
        $this->granted('DELETE', $content = $this->getClassContentByTypeAndUid($type, $uid));

        try {
            $this->getEntityManager()->getRepository('BackBee\ClassContent\AbstractClassContent')->deleteContent($content);
            $this->getEntityManager()->flush();
        } catch (\Exception $e) {
            throw new BadRequestHttpException("Unable to delete content with type: `$type` and uid: `$uid`");
        }

        return $this->createJsonResponse(null, 204);
    }
public function deleteAction($type, $uid)
    {
        $this->granted('DELETE', $content = $this->getClassContentByTypeAndUid($type, $uid));

        try {
            $this->getEntityManager()->getRepository('BackBee\ClassContent\AbstractClassContent')->deleteContent($content);
            $this->getEntityManager()->flush();
        } catch (\Exception $e) {
            throw new BadRequestHttpException("Unable to delete content with type: `$type` and uid: `$uid`");
        }

        return $this->createJsonResponse(null, 204);
    }
public function deleteAction ( $ type , $ uid ) { $ this -> granted ( 'DELETE' , $ content = $ this -> getClassContentByTypeAndUid ( $ type , $ uid ) ) ; try { $ this -> getEntityManager ( ) -> getRepository ( 'BackBee\ClassContent\AbstractClassContent' ) -> deleteContent ( $ content ) ; $ this -> getEntityManager ( ) -> flush ( ) ; } catch ( \ Exception $ e ) { throw new BadRequestHttpException ( "Unable to delete content with type: `$type` and uid: `$uid`" ) ; } return $ this -> createJsonResponse ( null , 204 ) ; }
delete a classcontent.

@param string $type type of the class content (ex: Element/text)
@param string $uid  identifier of the class content

@return Symfony\Component\HttpFoundation\JsonResponse

@Rest\Security("is_fully_authenticated() & has_role('ROLE_API_USER')")
delete a classcontent .