public function Alluser() { $us = new UsersController(); $em = $this->getDoctrine()->getManager(); $user = $us->getAllUserAction($em); $users = array(); foreach ($user as $value) { $UserId = $value->getId(); $UserName = $value->getUsername(); $users += [$UserId => $UserName]; } return $users; }
/** * Finds and displays a Client entity. * */ public function showAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('ErpBundle:Client')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Client entity.'); } $deleteForm = $this->createDeleteForm($id); $ProjectObject = new ProjectController(); $clientProject = $ProjectObject->getClientProject($em, $id); $userObject = new UsersController(); $users = $userObject->getAllUserAction($em); //var_dump($users); return $this->render('ErpBundle:Client:show.html.twig', array('entity' => $entity, 'clientProject' => $clientProject, 'users' => $users, 'delete_form' => $deleteForm->createView())); }