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