public function down()
 {
     Yii::$app->db->createCommand()->truncateTable(\common\models\Quiz::tableName())->execute();
 }
Example #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getQuiz()
 {
     return $this->hasOne(Quiz::className(), ['id' => 'quizID']);
 }
Example #3
0
 public function attributeLabels()
 {
     $quiz = new Quiz();
     return $quiz->attributeLabels();
 }
Example #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public static function findPublished()
 {
     $now = time();
     return parent::find()->andWhere("`dateEnd` >= '{$now}' AND `dateStart` <= '{$now}' AND `published` = '1'");
 }