コード例 #1
0
ファイル: ClienteDAO.php プロジェクト: jjaferson/ourives
	/**
	 * @param Cliente $cliente
	 * @throws ProblemaAcessoDadosException
	 * @return boolean
	 */
	public function existe(Cliente $cliente){
		try{
				
			$criteria = array("id" => $cliente->id);
			return parent::exist($cliente, $criteria);
	
		}catch (\Exception $ex){
			$msgLogger = self::MSG_PROBLEMA_BUSCAR . FacilLogger::gerarLogException($ex);
			FacilLogger::getLogger()->error($msgLogger);
			throw new ProblemaAcessoDadosException(self::MSG_PROBLEMA_BUSCAR);
		}
	}
コード例 #2
0
ファイル: UsuarioDAO.php プロジェクト: jjaferson/ourives
	/**
	 * verifica se o usuário existe atraves do e-mail
	 * @param Usuario $usuario
	 * @throws ProblemaAcessoDadosException
	 * @return boolean
	 */
	public function existePorEmail(Usuario $usuario){
		try{
	
			$criteria = array("email" => $usuario->email);
			return parent::exist($usuario, $criteria);
	
		}catch (\Exception $ex){
	
			$msgLogger = self::MSG_PROBLEMA_BUSCAR . FacilLogger::gerarLogException($ex);
			FacilLogger::getLogger()->error($msgLogger);
			throw new ProblemaAcessoDadosException(self::MSG_PROBLEMA_BUSCAR);
		}
	}