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

        /**
         * @return \WooBooking\CMS\Database\DatabaseQuery
         */
        public function getListQuery()
        {
            $db = Factory::getDBO();
            $query = $this->db->getQuery(true);
            $query->select('payment.*')
                ->from($this->getTableName('payment') . ' AS payment')
                ->where('payment.published=1');
            return $query;
        }
    }
}
