Category.php 498 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace yiiunit\data\ar;

/**
 * Class Category.
 *
 * @property integer $id
 * @property string $name
 */
class Category extends ActiveRecord
{
18 19
    public static function tableName()
    {
20
        return 'category';
21
    }
22

23 24 25 26
    public function getItems()
    {
        return $this->hasMany(Item::className(), ['category_id' => 'id']);
    }
27
}