Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
54 lines (47 sloc) 1.17 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;
/**
* Customer discount record.
*
* @property Customer $customer
* @property int $customerId
* @property Discount $discount
* @property int $discountId
* @property int $id
* @property int $uses
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
* @since 2.0
*/
class CustomerDiscountUse extends ActiveRecord
{
// Public Methods
// =========================================================================
/**
* @inheritdoc
*/
public static function tableName(): string
{
return '{{%commerce_customer_discountuses}}';
}
/**
* @return ActiveQueryInterface
*/
public function getDiscount(): ActiveQueryInterface
{
return $this->hasOne(Discount::class, ['id', 'discountId']);
}
/**
* @return ActiveQueryInterface
*/
public function getCustomer(): ActiveQueryInterface
{
return $this->hasOne(Customer::class, ['id', 'customerId']);
}
}
You can’t perform that action at this time.