Example #1
0
 /**
  * @param string $useragent
  */
 public function add($useragent)
 {
     $useragent = (string) $useragent;
     CM_Db_Db::replaceDelayed('cm_useragent', array('userId' => $this->_user->getId(), 'useragent' => $useragent, 'createStamp' => time()));
 }
Example #2
0
 /**
  * @param boolean $state
  * @throws CM_Exception_Invalid
  * @return CM_Model_User
  */
 public function setVisible($state = true)
 {
     $state = (int) $state;
     if (!$this->getOnline()) {
         throw new CM_Exception_Invalid('Must not modify visibility of a user that is offline');
     }
     CM_Db_Db::replaceDelayed('cm_user_online', array('userId' => $this->getId(), 'visible' => $state));
     $this->_set(array('online' => $this->getId(), 'visible' => $state));
     return $this;
 }