<?php

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

use Yii;

/**
 * This is the model class for table "ward".
 *
 * @property int $id
 * @property string $zone_id
 * @property string $ward_no
 * @property string $ward_name
 * @property string $WardH_Name
 * @property string $ward_EName
 * @property string $vsabha_no
 * @property string $muhalla
 */
class Ward extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'ward';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['zone_id', 'ward_no', 'ward_name', 'WardH_Name', 'ward_EName', 'vsabha_no', 'muhalla'], 'required'],
            [['zone_id', 'ward_no'], 'string', 'max' => 20],
            [['ward_name'], 'string', 'max' => 300],
            [['WardH_Name'], 'string', 'max' => 100],
            [['ward_EName'], 'string', 'max' => 200],
            [['vsabha_no'], 'string', 'max' => 10],
            [['muhalla'], 'string', 'max' => 1000],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'zone_id' => 'Zone ID',
            'ward_no' => 'Ward No',
            'ward_name' => 'Ward Name',
            'WardH_Name' => 'Ward H Name',
            'ward_EName' => 'Ward E Name',
            'vsabha_no' => 'Vsabha No',
            'muhalla' => 'Muhalla',
        ];
    }

    public static function DList(){
        $ward=Ward::find()->all();
        return $DList=ArrayHelper::map($ward,'id','WardH_Name');
    }
}
