コード例 #1
0
ファイル: User.php プロジェクト: jewelhuq/fraym
 /**
  * @param $userId
  * @return $this
  */
 public function setUserId($userId)
 {
     $this->user = $this->db->getRepository('\\Fraym\\User\\Entity\\User')->findOneById($userId);
     if (!$this->user) {
         $this->session->destroy();
         return $this;
     }
     $this->userId = $userId;
     $this->session->set('userId', $this->userId);
     if ($this->user) {
         $this->isLoggedIn = true;
         $this->user->isOnline = true;
         $this->user->lastLogin = new \DateTime();
         $this->db->persist($this->user);
         $this->db->flush();
     }
     return $this;
 }
コード例 #2
0
ファイル: Block.php プロジェクト: jewelhuq/fraym
 /**
  * @param $val
  * @return bool
  */
 public function setEditMode($val)
 {
     $this->inEditMode = $val;
     $this->session->set('inEditMode', $this->inEditMode);
     return true;
 }