This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function listEntitiesAction(Request $request) | |
{ | |
$entity = $request->query->get('entity'); | |
$table = $request->query->get('table'); | |
$repository = $this->getDoctrine()->getRepository('AALCOCompanyBundle:' . $entity); | |
$metadata = $this->getDoctrine()->getEntityManager()->getClassMetadata('AALCOCompanyBundle:' . $entity); | |
$qb = $repository->createQueryBuilder($table); | |
$dataTable = new Datatable( | |
$request->query->all(), | |
$repository, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function deleteUserAction($id) { | |
$em = $this->getDoctrine()->getManager(); | |
$parentUser = new User(); | |
$user = $em->getRepository('ACMECompanyBundle:User')->find($id); | |
$currentUser = $this->get('security.context')->getToken()->getUser(); | |
if ($id == $currentUser->getId()) { | |
return new Response("You cannot delete the current user"); | |
} | |