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