mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-04 14:34:49 +01:00
30 lines
537 B
PHP
30 lines
537 B
PHP
<?php
|
|
|
|
namespace yiiunit\data\ar;
|
|
|
|
/**
|
|
* Class OrderItem
|
|
*
|
|
* @property integer $order_id
|
|
* @property integer $item_id
|
|
* @property integer $quantity
|
|
* @property string $subtotal
|
|
*/
|
|
class OrderItem extends ActiveRecord
|
|
{
|
|
public static function tableName()
|
|
{
|
|
return 'order_item';
|
|
}
|
|
|
|
public function getOrder()
|
|
{
|
|
return $this->hasOne(Order::className(), ['id' => 'order_id']);
|
|
}
|
|
|
|
public function getItem()
|
|
{
|
|
return $this->hasOne(Item::className(), ['id' => 'item_id']);
|
|
}
|
|
}
|