/** * @return \yii\db\ActiveQuery */ public function getLoans() { return $this->hasMany(Loans::className(), ['userId' => 'userId']); }