You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
769 B

13 years ago
<?php
namespace yiiunit\data\ar;
class Order extends ActiveRecord
{
public static function tableName()
{
return 'tbl_order';
}
13 years ago
public static function relations()
{
return array(
'customer:Customer' => array(
13 years ago
'link' => array('id' => 'customer_id'),
),
'orderItems:OrderItem' => array(
'link' => array('order_id' => 'id'),
),
'items:Item[]' => array(
'via' => 'orderItems',
'link' => array(
'id' => 'item_id',
),
'order' => '@.id',
),
'books:Item[]' => array(
'joinType' => 'INNER JOIN',
'via' => array(
'table' => 'tbl_order_item',
'link' => array(
'order_id' => 'id',
),
),
'link' => array(
'id' => 'item_id',
),
'on' => '@.category_id = 1',
13 years ago
),
);
}
13 years ago
}