update Area + Device
This commit is contained in:
61
models/Device.php
Normal file
61
models/Device.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user