<?php

namespace app\models;
use yii\helpers\ArrayHelper;

use Yii;

/**
 * This is the model class for table "zone_master".
 *
 * @property int $zone_id
 * @property string $zone_code
 * @property string $zone_name
 * @property string|null $comm_eng_name
 * @property string|null $comm_hin_name
 * @property string|null $ho_name
 */
class ZoneMaster extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'zone_master';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['zone_id', 'zone_code', 'zone_name'], 'required'],
            [['zone_id'], 'integer'],
            [['zone_code'], 'string', 'max' => 50],
            [['zone_name', 'comm_eng_name'], 'string', 'max' => 100],
            [['comm_hin_name'], 'string', 'max' => 300],
            [['ho_name'], 'string', 'max' => 250],
            [['zone_id'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'zone_id' => 'Zone ID',
            'zone_code' => 'Zone Code',
            'zone_name' => 'Zone Name',
            'comm_eng_name' => 'Comm Eng Name',
            'comm_hin_name' => 'Comm Hin Name',
            'ho_name' => 'Ho Name',
        ];
    }
    public static function DList(){
        $zone=self::find()->all();
        return $DList=ArrayHelper::map($zone,'zone_id','zone_name');
    }
}
