55 lines
1.1 KiB
PHP
55 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace app\models;
|
|
|
|
use Yii;
|
|
|
|
/**
|
|
* This is the model class for table "area".
|
|
*
|
|
* @property int $id
|
|
* @property int $code
|
|
* @property int $pid
|
|
* @property string $name
|
|
* @property string $description
|
|
* @property int $created_at
|
|
* @property int $modified_at
|
|
*/
|
|
class Area extends \yii\db\ActiveRecord {
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public static function tableName() {
|
|
return 'area';
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function rules() {
|
|
return [
|
|
[['code', 'name'], 'required'],
|
|
[['code', 'pid', 'created_at', 'modified_at'], 'integer'],
|
|
[['description'], 'string'],
|
|
[['name'], 'string', 'max' => 100],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function attributeLabels() {
|
|
return [
|
|
'id' => 'ID',
|
|
'code' => 'Mã khu vực',
|
|
'pid' => 'Khu vực cha',
|
|
'name' => 'Tên khu vực',
|
|
'description' => 'Chú thích',
|
|
'created_at' => 'Thời gian tạo',
|
|
'modified_at' => 'Thời gian sửa',
|
|
];
|
|
}
|
|
|
|
}
|