コード例 #1
0
ファイル: Content.php プロジェクト: portalsway2/APEDevices
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDevice()
 {
     return $this->hasOne(Device::className(), ['id' => 'device_id']);
 }
コード例 #2
0
ファイル: Product.php プロジェクト: portalsway2/APEDevices
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDevices()
 {
     return $this->hasMany(Device::className(), ['device_product_id' => 'id']);
 }