OrderItem.php 496 Bytes
Newer Older
Qiang Xue committed
1 2 3 4
<?php

namespace yiiunit\data\ar;

5 6 7 8 9 10 11 12
/**
 * Class OrderItem
 *
 * @property integer $order_id
 * @property integer $item_id
 * @property integer $quantity
 * @property string $subtotal
 */
Qiang Xue committed
13 14
class OrderItem extends ActiveRecord
{
Qiang Xue committed
15
	public static function tableName()
Qiang Xue committed
16 17 18 19
	{
		return 'tbl_order_item';
	}

Qiang Xue committed
20
	public function getOrder()
Qiang Xue committed
21
	{
22
		return $this->hasOne(Order::className(), ['id' => 'order_id']);
Qiang Xue committed
23 24
	}

Qiang Xue committed
25
	public function getItem()
Qiang Xue committed
26
	{
27
		return $this->hasOne(Item::className(), ['id' => 'item_id']);
Qiang Xue committed
28
	}
Zander Baldwin committed
29
}