Ejemplo n.º 1
0
	/**
	 * @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);
		}
	}
Ejemplo n.º 2
0
	/**
	 * @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);
		}
	}		
Ejemplo n.º 3
0
	/**
	 * 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);
		}
	}