<?php

namespace app\modules\hub\models\db;

use Yii;

/**
 * This is the model class for table "ist_hub_type".
 *
 * @property int $id
 * @property string $type
 * @property string $created_on
 *
 * @property IstHub[] $istHubs
 */
class IstHubType extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'ist_hub_type';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['type', 'created_on'], 'required'],
            [['created_on'], 'safe'],
            [['type'], 'string', 'max' => 28],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'type' => 'Type',
            'created_on' => 'Created On',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getIstHubs()
    {
        return $this->hasMany(IstHub::className(), ['type_id' => 'id']);
    }
}
