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