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