public function deleteAction()
	{
		$page = $this->getPageLocalization()
				->getMaster();

		$entityManager = $this->getEntityManager();

		$count = (int) $entityManager->createQuery(sprintf('SELECT COUNT(p.id) FROM %s p WHERE p.template = ?0', PageLocalization::CN()))
				->setParameters(array($page->getId()))
				->getSingleScalarResult();

		if ($count > 0) {
			throw new CmsException(null, "Cannot remove template, {$count} page(s) still uses it.");
		}

		$entityManager->remove($page);
		$entityManager->flush();

		return new SupraJsonResponse();
	}
public function deleteAction()
	{
		$page = $this->getPageLocalization()
				->getMaster();

		$entityManager = $this->getEntityManager();

		$count = (int) $entityManager->createQuery(sprintf('SELECT COUNT(p.id) FROM %s p WHERE p.template = ?0', PageLocalization::CN()))
				->setParameters(array($page->getId()))
				->getSingleScalarResult();

		if ($count > 0) {
			throw new CmsException(null, "Cannot remove template, {$count} page(s) still uses it.");
		}

		$entityManager->remove($page);
		$entityManager->flush();

		return new SupraJsonResponse();
	}
public function deleteAction ( ) { $ page = $ this -> getPageLocalization ( ) -> getMaster ( ) ; $ entityManager = $ this -> getEntityManager ( ) ; $ count = ( int ) $ entityManager -> createQuery ( sprintf ( 'SELECT COUNT(p.id) FROM %s p WHERE p.template = ?0' , PageLocalization :: CN ( ) ) ) -> setParameters ( array ( $ page -> getId ( ) ) ) -> getSingleScalarResult ( ) ; if ( $ count > 0 ) { throw new CmsException ( null , "Cannot remove template, {$count} page(s) still uses it." ) ; } $ entityManager -> remove ( $ page ) ; $ entityManager -> flush ( ) ; return new SupraJsonResponse ( ) ; }
Template delete action.

@return SupraJsonResponse
Template delete action .