/** * @return \yii\db\ActiveQuery */ public function getDevice() { return $this->hasOne(Device::className(), ['id' => 'device_id']); }
/** * @return \yii\db\ActiveQuery */ public function getDevices() { return $this->hasMany(Device::className(), ['domain_id' => 'id']); }