Server_AccessControl/models/Device.php
2020-10-08 17:12:19 +07:00

62 lines
1.3 KiB
PHP

<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "device".
*
* @property int $id
* @property string $name
* @property string $serial
* @property string $ip_address
* @property int $status
* @property int $type
* @property int $area_id
* @property int $created_at
* @property int $modified_at
*/
class Device extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'device';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['name', 'ip_address', 'status', 'type', 'area_id'], 'required'],
[['status', 'type', 'area_id', 'created_at', 'modified_at'], 'integer'],
[['name'], 'string', 'max' => 100],
[['serial'], 'string', 'max' => 50],
[['ip_address'], 'string', 'max' => 20],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'name' => 'Name',
'serial' => 'Serial',
'ip_address' => 'Ip Address',
'status' => 'Status',
'type' => 'Type',
'area_id' => 'Area ID',
'created_at' => 'Created At',
'modified_at' => 'Modified At',
];
}
}