Exemple #1
0
 function UserSession()
 {
     $ci =& get_instance();
     $ci->load->library('session');
     $ci->load->helper('object');
     $ci->load->helper('array');
     $session = $ci->session->userdata(MEMBER_SESSION_KEY);
     if (false === empty($session)) {
         ArrayHelper::bindArrayToObject($session, $this);
     } else {
         $this->id = 0;
         $this->roles[] = 'Guest';
         $this->_refreshSession();
     }
 }
Exemple #2
0
 function __construct()
 {
     $ci =& get_instance();
     $ci->load->library('session');
     $ci->load->helper('object');
     $ci->load->helper('array');
     $ci->load->table('gamesession');
     $session = $ci->session->userdata(GAME_SESSION_KEY);
     if (false === empty($session)) {
         ArrayHelper::bindArrayToObject($session, $this);
     } else {
         $this->id = 0;
         $this->completedquestions = array();
         $this->_refreshSession();
     }
     $this->_loadDBSession();
 }
 /**
  * Binds the table delegate to an associative array or object with keys or public attributes
  * that match the table delegates public attributes
  *
  * @access public
  * @param mixed $source		The source of the binding
  */
 function bind($source)
 {
     if (true === is_array($source)) {
         ArrayHelper::bindArrayToObject($source, $this, true);
     } else {
         if (true === is_object($source)) {
             ObjectHelper::shallowCopy($source, $this, true, true);
         }
     }
 }