                <?php
defined('_WPBOOKINGPRO_EXEC') or die;
if(!class_exists("WpBookingPro_CategoriesModel")) {
    /**
     * Class WpBookingPro_CategoriesModel
     */
    class WpBookingPro_CategoriesModel extends WoobookingModelList
    {
        /**
         * @var string
         */
        public $table_name = "category";
        /**
         * @var string
         */
        public $context = "categories";
        /**
         * @var string
         */
        public $modelItem = "category";

        /**
         * @return void|\WooBooking\CMS\Database\DatabaseQuery
         */
        public function buildQuery()
        {
            $orderCol = $this->state->get('list.ordering', 'category.id');
            $query = $this->db->getQuery(true);
            $query->select('category.*')
                ->from($this->getTableName() . ' AS category');
            return $query;
        }

        /**
         * @param string $ordering
         * @param string $direction
         */
        public function populateState($ordering = 'a.id', $direction = 'desc')
        {
            parent::populateState($ordering, $direction); // TODO: Change the autogenerated stub
        }
    }
}