/** * @return \yii\db\ActiveQuery */ public function getCandidates() { return $this->hasMany(Candidate::className(), ['election_id' => 'id']); }