コード例 #1
0
 public function listAllFiltered($filters = array(), $order = null, $resultType = ResultType::ObjectType)
 {
     $qb = $this->getQB();
     if (array_key_exists('nombre', $filters) && $filters['nombre'] != null) {
         $param = Util::makeCanonic($filters['nombre']);
         $qb->andWhere('usuario.canonic_name like :nombre')->setParameter('nombre', "%{$param}%");
     }
     /*if(is_array($order) && array_key_exists('nombre',$order)) {
           $order[]=array('apellidos'=>$order[1]);
       }*/
     return $this->filterQB($qb, $filters, $resultType, $order);
 }
コード例 #2
0
 public function checkExistanceAction()
 {
     $groupType = new GroupType();
     $newGroupParam = $this->getParameter($groupType->getName())['name'];
     $newGroup = $this->get('fos_user.group_manager')->findGroupByName($newGroupParam);
     $name = $this->getParameter('name');
     $group = $this->get('fos_user.group_manager')->findGroupByName($name);
     $edit = $this->getParameter('edit');
     if ($newGroup instanceof Grupo && Util::Canonicalize($name) != Util::Canonicalize($newGroupParam) && $edit == true) {
         return new JsonResponse("El grupo <b>{$newGroupParam}</b> ya se encuentra en uso.");
     }
     if ($group instanceof Grupo && $newGroup instanceof Grupo && $edit != true) {
         return new JsonResponse("El grupo <b>{$name}</b> ya se encuentra en uso.");
     }
     return new JsonResponse(true);
 }
コード例 #3
0
ファイル: Usuario.php プロジェクト: jjspider277/weddings
 /**
  * @ORM\PrePersist
  * @ORM\PreUpdate
  */
 public function canonicalization()
 {
     if ($this->nombre != null && strlen($this->nombre) > 0) {
         $this->canonic_name = Util::makeCanonic($this->nombre);
     }
 }
コード例 #4
0
 public function checkMailExistanceAction()
 {
     $name = $this->getParameter('email');
     $user = $this->get('fos_user.user_manager')->findUserByEmail($name);
     $edit = $this->getParameter('edit');
     $userType = new UsuarioType();
     if ($edit == true) {
         $userType = new UsuarioEditType();
     }
     $newUserParam = $this->getParameter($userType->getName())['email'];
     $newUser = $this->get('fos_user.user_manager')->findUserByEmail($newUserParam);
     if ($newUser instanceof Usuario && Util::Canonicalize($name) != Util::Canonicalize($newUserParam) && $edit == true) {
         return new JsonResponse("El correo <b>{$newUserParam}</b> ya se encuentra en uso.");
     }
     if ($user instanceof Usuario && $newUser instanceof Usuario && $edit != true) {
         return new JsonResponse("El correo <b>{$name}</b> ya se encuentra en uso.");
     }
     return new JsonResponse(true);
 }
コード例 #5
0
ファイル: UsuarioTable.php プロジェクト: jjspider277/weddings
 public function constructData()
 {
     $order = $this->getTableSortByRequest();
     //        ldd($order);
     if (count($order) == 0) {
         $order['id'] = 'desc';
     }
     $this->datos = $this->getRepo()->listAllFiltered($this->getTableFiltersByRquest(), $order);
     $result = array();
     foreach ($this->datos as $row) {
         $tmpArray = array();
         $tmpArray[] = $row->getUserName();
         $tmpArray[] = $row->getCedula();
         $tmpArray[] = $row->getNombre();
         $tmpArray[] = $row->getEmail();
         $tmpArray[] = Util::boolean($row->isEnabled());
         $result[] = $tmpArray;
     }
     return $result;
 }
コード例 #6
0
ファイル: Util.php プロジェクト: jjspider277/weddings
 public function canonicalize($name)
 {
     return Util::makeCanonic($name);
 }