/** * @throws ProblemaAcessoDadosException * @return ArrayCollection */ public function listar(){ try{ $criteria = Criteria::expr()->notIn("id", array(Perfil::ADMINISTRADOR, Perfil::OURIVES)); return parent::findWithCriteria(new Perfil(), $criteria); }catch (\Exception $ex){ $msgLogger = self::MSG_PROBLEMA_LISTAR . FacilLogger::gerarLogException($ex); FacilLogger::getLogger()->error($msgLogger); throw new ProblemaAcessoDadosException(self::MSG_PROBLEMA_LISTAR); } }
/** * @throws ProblemaAcessoDadosException */ public function listarAtivas() { try { $criteria = Criteria::expr()->eq('ativo', 'true'); return parent::findWithCriteria(new CategoriaOS(), $criteria); } catch (\Exception $e) { $msgLogger = self::MSG_PROBLEMA_LISTAR . FacilLogger::gerarLogException($ex); FacilLogger::getLogger()->error($msgLogger); throw new ProblemaAcessoDadosException(self::MSG_PROBLEMA_BUSCAR); } }
/** * listar todos por perfil. * @throws ProblemaAcessoDadosException * @return ArrayCollection */ public function listarPorPerfil(Perfil $perfil){ try{ $criteria = Criteria::expr()->eq('perfil', $perfil); return parent::findWithCriteria(new Usuario(), $criteria); }catch (\Exception $ex){ $msgLogger = self::MSG_PROBLEMA_LISTAR . FacilLogger::gerarLogException($ex); FacilLogger::getLogger()->error($msgLogger); throw new ProblemaAcessoDadosException(self::MSG_PROBLEMA_LISTAR); } }