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

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

            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
        }
    }
}