Beispiel #1
0
	/**
	 * @throws ProblemaAcessoDadosException
	 * @return Menu $menu
	 */
	public function buscarMenu(Menu $menu){
		try{
	
			return parent::findBy($menu, array('id' => $menu->id));
	
		}catch (\Exception $ex){
			$msgLogger = self::MSG_PROBLEMA_LISTAR . FacilLogger::gerarLogException($ex);
			FacilLogger::getLogger()->error($msgLogger);
			throw new ProblemaAcessoDadosException(self::MSG_PROBLEMA_LISTAR);
		}
	}
Beispiel #2
0
	/**
	 * Busca um usuário pelo e-mail
	 * 
	 * @param Usuario $usuario
	 * @throws ProblemaAcessoDadosException
	 * @return Usuario $usuario
	 */
	public function buscarPorEmail(Usuario $usuario){
		try{
	
			$criteria = array("email" => $usuario->email);
			return parent::findBy($usuario, $criteria);
	
		}catch (\Exception $ex){
			$msgLogger = self::MSG_PROBLEMA_BUSCAR . FacilLogger::gerarLogException($ex);
			FacilLogger::getLogger()->error($msgLogger);
			throw new ProblemaAcessoDadosException(self::MSG_PROBLEMA_BUSCAR);
		}
	}