8 * This is the model class for table "{{%types}}".
10 * @property int $id Идентификатор типа (неизменяемое)
11 * @property string|null $name Тип оборудования
13 * @property Items[] $items
15 class Types extends \yii\db\ActiveRecord
20 public static function tableName()
28 public function rules()
31 [['name'], 'string', 'max' => 20],
38 public function attributeLabels()
41 'id' => Yii::t('app', 'Идентификатор типа (неизменяемое)'),
42 'name' => Yii::t('app', 'Тип оборудования'),
47 * Gets query for [[Items]].
49 * @return \yii\db\ActiveQuery
51 public function getItems()
53 return $this->hasMany(Items::className(), ['type_id' => 'id']);