/** * @return \yii\db\ActiveQuery */ public function getCompany() { return $this->hasOne(Companies::className(), ['id' => 'company_id']); }
/** * Logs in a user using the provided username and password. * * @return boolean whether the user is logged in successfully */ public function getuserCompany() { //$company = User::findAllByAttributes(['company_id']) return $this->hasMany(Companies::className(), ['company_id' => 'company_id']); }