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); }
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); }
/** * @ORM\PrePersist * @ORM\PreUpdate */ public function canonicalization() { if ($this->nombre != null && strlen($this->nombre) > 0) { $this->canonic_name = Util::makeCanonic($this->nombre); } }
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); }
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; }
public function canonicalize($name) { return Util::makeCanonic($name); }