Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
75 lines (66 sloc) 1.7 KB
<?php
/**
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license https://craftcms.github.io/license/
*/
namespace craft\commerce\records;
use craft\db\ActiveRecord;
use yii\db\ActiveQueryInterface;
/**
* Order history record.
*
* @property Customer $customer
* @property int $customerId
* @property \DateTime $dateCreated
* @property int $id
* @property string $message
* @property OrderStatus $newStatus
* @property int $newStatusId
* @property Order $order
* @property int $orderId
* @property OrderStatus $prevStatus
* @property int $prevStatusId
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
* @since 2.0
*/
class OrderHistory extends ActiveRecord
{
// Public Methods
// =========================================================================
/**
* @inheritdoc
*/
public static function tableName(): string
{
return '{{%commerce_orderhistories}}';
}
/**
* @return ActiveQueryInterface
*/
public function getOrder(): ActiveQueryInterface
{
return $this->hasOne(Order::class, ['id' => 'orderId']);
}
/**
* @return ActiveQueryInterface
*/
public function getPrevStatus(): ActiveQueryInterface
{
return $this->hasOne(OrderStatus::class, ['id' => 'prevStatusId']);
}
/**
* @return ActiveQueryInterface
*/
public function getNewStatus(): ActiveQueryInterface
{
return $this->hasOne(OrderStatus::class, ['id' => 'newStatusId']);
}
/**
* @return ActiveQueryInterface
*/
public function getCustomer(): ActiveQueryInterface
{
return $this->hasOne(Customer::class, ['id' => 'customerId']);
}
}
You can’t perform that action at this time.