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.2 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 craft\elements\Category;
use yii\db\ActiveQueryInterface;
/**
* Discount Product type record.
*
* @property ActiveQueryInterface $category
* @property int $categoryId
* @property ActiveQueryInterface $discount
* @property int $discountId
* @property int $id
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
* @since 2.0
*/
class DiscountCategory extends ActiveRecord
{
// Public Methods
// =========================================================================
/**
* @inheritdoc
*/
public static function tableName(): string
{
return '{{%commerce_discount_categories}}';
}
/**
* @return ActiveQueryInterface
*/
public function getDiscount(): ActiveQueryInterface
{
return $this->hasOne(Discount::class, ['id' => 'discountId']);
}
/**
* @return ActiveQueryInterface
*/
public function getCategory(): ActiveQueryInterface
{
return $this->hasOne(Category::class, ['id' => 'categoryId']);
}
}
You can’t perform that action at this time.