/** * Activity relation. * @return Activity */ public function getActivity() { return $this->hasOne(Activity::className(), ['user_id' => 'id']); }
/** * Sets relation with Activity. * @return \yii\db\ActiveQuery */ public function getActivity() { return $this->user->hasOne(Activity::className(), ['user_id' => $this->getId()]); }