<?php
namespace WpBookingHotelAdmin\app\models;
defined('_WPBOOKINGHOTEL_EXEC') or die;

use WpBookingHotel\Factory;
use WpBookingHotel\Mvc\Model\ModelForm;
use WpBookingHotel\Form\Form;
use WpBookingHotel\Mvc\Model\ModelList;
use WpBookingHotel\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;
    }


}
