示例#1
0
 public function componentUser()
 {
     $this->userstates = entities\Userstate::getAll();
     $this->onlinestate = framework\Settings::getOnlineState();
     $this->awaystate = framework\Settings::getAwayState();
     $this->offlinestate = framework\Settings::getOfflineState();
 }
示例#2
0
 /**
  * Get the current user state
  *
  * @return \thebuggenie\core\entities\Userstate
  */
 public function getState()
 {
     $active = $this->isActive();
     $away = $this->isAway();
     if ($this->_customstate && ($active || $away)) {
         $this->_b2dbLazyload('_userstate');
         if ($this->_userstate instanceof Userstate) {
             return $this->_userstate;
         }
     }
     if ($active) {
         return framework\Settings::getOnlineState();
     } elseif ($away) {
         return framework\Settings::getAwayState();
     } else {
         return framework\Settings::getOfflineState();
     }
 }