|
- <?php
-
-
-
- namespace domain\Document\Invoice;
-
- use domain\Document\Document\Document;
- use domain\Payment\Payment;
-
-
- class Invoice extends Document
- {
- public $deliveryNotes;
- public $ordersOnCreate;
-
-
-
- public static function tableName()
- {
- return 'invoice';
- }
-
-
-
-
- public function getOrders()
- {
- return $this->relationOrders('id_invoice');
- }
-
- public function getPayments()
- {
- return $this->hasMany(Payment::class, ['id_invoice' => 'id'])
- ->orderBy(['payment.id' => SORT_DESC]);
- }
- }
|