OrderItem.php 537 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
{
15 16
    public static function tableName()
    {
17
        return 'order_item';
18
    }
Qiang Xue committed
19

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

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