id()); } else if (is_numeric($login)) { $res = XDB::query('SELECT p.pid, p.hrpid FROM profiles AS p WHERE p.pid = {?}', $login); } else { $res = XDB::query('SELECT p.pid, p.hrpid FROM profiles AS p WHERE p.hrpid = {?}', $login); } if ($res->numRows() != 1) { throw new UserNotFoundException(); } list($this->pid, $this->hrpid) = $res->fetchOneRow(); } public function id() { return $this->pid; } public function hrid() { return $this->hrpid; } public function owner() { return User::getSilent($this); } /** Return the profile associated with the given login. */ public static function get($login) { try { return new Profile($login); } catch (UserNotFoundException $e) { return false; } } } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>