Example #1
0
 public function initialize()
 {
     parent::initialize();
     $db = Db::connection();
     $db->tableExists($this->_table) or $this->createTable();
     $db->delete($this->_table);
 }
Example #2
0
 /**
  * @param User $user
  * @return $this
  */
 public function setUserAsLoggedIn($user)
 {
     $this->user = $user;
     $user and Session::set($this->sessionKey . '.uid', $user->getId());
     return $this;
 }