mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-04 09:00:46 +08:00
27 lines
466 B
PHP
27 lines
466 B
PHP
<?php
|
|
|
|
namespace yiiunit\data\ar\mongodb;
|
|
|
|
class CustomerOrder extends ActiveRecord
|
|
{
|
|
public static function collectionName()
|
|
{
|
|
return 'customer_order';
|
|
}
|
|
|
|
public function attributes()
|
|
{
|
|
return [
|
|
'_id',
|
|
'number',
|
|
'customer_id',
|
|
'items',
|
|
];
|
|
}
|
|
|
|
public function getCustomer()
|
|
{
|
|
return $this->hasOne(Customer::className(), ['_id' => 'customer_id']);
|
|
}
|
|
}
|