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