mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-04 14:34:49 +01:00
24 lines
380 B
PHP
24 lines
380 B
PHP
<?php
|
|
|
|
namespace yiiunit\data\ar;
|
|
|
|
/**
|
|
* Class Item
|
|
*
|
|
* @property integer $id
|
|
* @property string $name
|
|
* @property integer $category_id
|
|
*/
|
|
class Item extends ActiveRecord
|
|
{
|
|
public static function tableName()
|
|
{
|
|
return 'item';
|
|
}
|
|
|
|
public function getCategory()
|
|
{
|
|
return $this->hasOne(Category::className(), ['id' => 'category_id']);
|
|
}
|
|
}
|