/** * @return \yii\db\ActiveQuery */ public function getActiveRules() { return $this->hasMany(FormRule::className(), ['form_id' => 'id'])->where('status = :status', [':status' => FormRule::STATUS_ACTIVE]); }