/** * @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); } }
/** * 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); } }