/
OrderAdjustment.php
51 lines (46 loc) · 1.13 KB
/
OrderAdjustment.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license https://craftcms.github.io/license/
*/
namespace craft\commerce\records;
use craft\commerce\db\Table;
use craft\db\ActiveRecord;
use yii\db\ActiveQueryInterface;
/**
* Order adjustment record.
*
* @property float $amount
* @property string $description
* @property int $id
* @property bool $included
* @property int|null $lineItemId
* @property string $name
* @property Order $order
* @property int $orderId
* @property string $sourceSnapshot
* @property string $type
* @property bool $isEstimated
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
* @since 2.0
*/
class OrderAdjustment extends ActiveRecord
{
// Public Methods
// =========================================================================
/**
* @inheritdoc
*/
public static function tableName(): string
{
return Table::ORDERADJUSTMENTS;
}
/**
* @return ActiveQueryInterface
*/
public function getOrder(): ActiveQueryInterface
{
return $this->hasOne(Order::class, ['id' => 'orderId']);
}
}