예제 #1
0
 /**
  * Retrieves the current active board ID for this session
  * if not found an error is thrown
  * If found returns the board active record matching the ID
  *
  * @throws yii\web\NotFoundHttpException
  * @return \yii\db\ActiveRecord
  */
 public static function getActiveboard()
 {
     $session = Yii::$app->session;
     $currentBoardId = $session->get('currentBoardId');
     if ($currentBoardId == self::NO_ACTIVE_BOARD_STATUS_TEST) {
         throw new NotFoundHttpException(self::NO_ACTIVE_BOARD_MESSAGE);
     } else {
         Ticket::restrictQueryToBoard($currentBoardId);
         return self::findOne($currentBoardId);
     }
 }