<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "shipment_mode".
 *
 * @property int $id
 * @property string|null $name
 *
 * @property SystemTracker[] $systemTrackers
 */
class ShipmentMode extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'shipment_mode';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['name'], 'string', 'max' => 255],
            [['name'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
        ];
    }

    /**
     * Gets query for [[SystemTrackers]].
     *
     * @return \yii\db\ActiveQuery
     */
    public function getSystemTrackers()
    {
        return $this->hasMany(SystemTracker::class, ['mode_shipment' => 'id']);
    }
}
