<?php

namespace app\models;

use Yii;

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

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

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

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