<?php

namespace app\models;

use Yii;

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

    /**
     * {@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, ['broker_id' => 'id']);
    }
}
