/** * @return \yii\db\ActiveQuery */ public function getUser() { return $this->hasOne(User::className(), ['id' => 'user_id']); }
public function getUsers() { return $this->hasMany(User::className(), ['id' => 'user_id'])->via('userGroups'); }
public function rules() { return [['email', 'filter', 'filter' => 'trim'], ['email', 'required'], ['email', 'email'], ['email', 'unique', 'targetClass' => User::className()], ['password', 'required'], ['password', 'string']]; }