/** * @return \yii\db\ActiveQuery */ public function getVotes() { return $this->hasMany(Vote::className(), ['election_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getVotes() { return $this->hasMany(Vote::className(), ['created_by' => 'id']); }
public function getVotes() { return $this->hasMany(Vote::className(), ['id' => 'vote_id'])->viaTable('vote_option', ['option_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getVote() { return $this->hasOne(Vote::className(), ['id' => 'vote_id']); }
/** * @return \yii\db\ActiveQuery */ public function getVote() { //return $this->hasMany(Vote::className(), ['code_id' => 'id']); return $this->hasOne(Vote::className(), ['code_id' => 'id']); }