コード例 #1
0
ファイル: User.php プロジェクト: sap55/yii2-order-management
 public function getDevices()
 {
     return $this->hasMany(Device::className(), ['user_id' => 'user_id']);
 }
コード例 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDevice0()
 {
     return $this->hasOne(Device::className(), ['id' => 'device']);
 }