Пример #1
0
 public function getOrderClass()
 {
     return Order::className();
 }
Пример #2
0
 public function getOrders()
 {
     return $this->hasMany(Order::className(), ['customer_id' => 'id'])->orderBy('created_at');
 }
Пример #3
0
 public function getExpensiveOrders()
 {
     return $this->hasMany(Order::className(), ['customer_id' => 'id'])->filter(['range' => ['total' => ['gte' => 50]]])->orderBy('id');
 }
Пример #4
0
 public function getOrder()
 {
     return $this->hasOne(Order::className(), ['id' => 'order_id']);
 }