<?php
namespace WpBookingEventFrontend\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;
use WpBookingEventAdmin\app\helpers\AdminHelper;
use WpBookingEventFrontend\app\Html\HtmlFrontend;

class RatesModel extends ModelList
{
    /**
     * @var string
     */
    public $context = "rates";
    /**
     * @var string
     */
    public $table_name = "rate";

    public function getListRateByEventId($event_id) {
        $query = $this->_db->getQuery(true);
        $query->select('rate.*')
            ->from($this->getTableName('rate').' AS rate')
            ->where('rate.object_id='.(int)$event_id)
            ;
        $list_rate = $this->_db->setQuery($query)->loadObjectList();
        return $list_rate;
    }

}
