<?php

namespace app\models\entity;

use Yii;

/**
 * This is the model class for table "locations".
 *
 * @property int $id
 * @property string $name
 * @property string $description
 * @property int $x
 * @property int $y
 * @property int $company_id
 * @property string $type
 */
class Locations extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'locations';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['name'], 'required'],
            [['x', 'y', 'company_id'], 'integer'],
            [['name', 'description'], 'string', 'max' => 255],
            [['img'], 'safe'],
            [['type'], 'string', 'max' => 15],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'ID датчика',
            'description' => 'Описание',
            'x' => 'X',
            'y' => 'Y',
            'company_id' => 'Company ID',
            'type' => 'Type',
        ];
    }
}