/** * @return \yii\db\ActiveQuery */ public function getRolesCode() { return $this->hasOne(Roles::className(), ['code' => 'roles_code']); }
/** * @return \yii\db\ActiveQuery */ public function getRole() { return $this->hasOne(Roles::className(), ['id' => 'role_id']); }