/** * @return \yii\db\ActiveQuery */ public function getSeasonDetails() { return $this->hasMany(SeasonDetails::className(), ['season_id' => 'id']); }
public function getLastSeasonDetails() { return $this->hasOne(SeasonDetails::className(), ['team_id' => 'id'])->orderBy('id DESC')->one(); }