/** * Get current user * @param string $default // default user * @return mixed // instance of model User, default username, or false, if user isn't in database */ public function getUser($default = null) { if ($this->_user instanceof User) { return $this->_user; } $username = parent::getUser(); if (!$username) { return $default; } return $this->_getUser($username); }