示例#1
0
 public function getOrders()
 {
     return $this->hasMany(Order::className(), ['id' => 'order_id'])->via('orderItems');
 }
 public function getOrder()
 {
     return $this->hasOne(Order::className(), ['id' => 'order_id']);
 }
示例#3
0
 public function getOrders2()
 {
     return $this->hasMany(Order::className(), ['customer_id' => 'id'])->inverseOf('customer2')->orderBy('id');
 }