-
Notifications
You must be signed in to change notification settings - Fork 170
/
OrderStatus.php
52 lines (46 loc) · 1.18 KB
/
OrderStatus.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
52
<?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 craft\db\SoftDeleteTrait;
use yii\db\ActiveQueryInterface;
/**
* Order status record.
*
* @property string $color
* @property bool $default
* @property Email[] $emails
* @property string $handle
* @property string $description
* @property int $id
* @property bool $dateDeleted
* @property string $name
* @property int $sortOrder
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
* @since 2.0
*/
class OrderStatus extends ActiveRecord
{
// Public Methods
// =========================================================================
use SoftDeleteTrait;
/**
* @inheritdoc
*/
public static function tableName(): string
{
return Table::ORDERSTATUSES;
}
/**
* @return ActiveQueryInterface
*/
public function getEmails(): ActiveQueryInterface
{
return $this->hasMany(Email::class, ['id' => 'emailId'])->viaTable(Table::ORDERSTATUS_EMAILS, ['orderStatusId' => 'id']);
}
}