public static function get_current() { $userid = get_current_user_id(); if (empty($userid)) { return new static::$model(); } else { $user = new static::$model(array('id' => $userid)); $user->fetch(); return $user; } }