<?php
namespace WpBookingEventAdmin\app\models;
defined('_WPBOOKINGEVENT_EXEC') or die;

use WpBookingEvent\Factory;
use WpBookingEvent\Mvc\Model\ModelForm;
use WpBookingEvent\Form\Form;
use WpBookingEvent\Mvc\Model\ModelList;
use WpBookingEvent\Registry\Registry;
class StatesModel extends ModelList
{
    /**
     * @var string
     */
    public $context = "states";
    /**
     * @var string
     */
    public $table_name = "state";
    public function getListQuery()
    {
        $query = $this->_db->getQuery(true);
        $query->clear()
            ->select('a.*')
            ->from($this->getTableName() . ' AS a')
            ->leftJoin($this->getTableName('country') . ' AS country ON country.id =a.country_id')
            ->select('country.countryname  AS country_name');
        return $query;
    }


}
