Esempio n. 1
0
 /**
  * Action that return all user role in the db     
  * @return JSON list of all user role 
  */
 public function getAllRolesAction()
 {
     try {
         DataUtility::setEntityManager($this->get('doctrine.orm.entity_manager'));
         $resp = new ServerResponse();
         $resp->setResponseData(UsersRoleBiz::getAllRoleAsArray());
         return new Response($resp->jsonEncode());
     } catch (\Exception $ex) {
         $resp = new ServerResponse();
         $resp->addErrorInfo("System", $ex->getMessage());
         return new Response($resp->jsonEncode());
     }
 }
Esempio n. 2
0
 /**
  * Get all roles in DB
  * @return Array of UsersRole
  */
 public static function getAllRoleAsArray()
 {
     $em = DataUtility::getEntityManager();
     $query = $em->createQuery(self::_getAllRoleSQL);
     return $query->getArrayResult();
 }