<?php
namespace TourOperatorProAdmin\app\helpers;

use TourOperatorPro\Factory;
use TourOperatorPro\Utilities\Utility;

class RateHelper extends AdminHelper
{

    public static function getTourRateKey(){
        return 'rate';
    }
    public static function insertNewPropertyByKey($key='', $list_tour_id=array(), $rate_id=0) {
        $db = Factory::getDBO();
        $query =$db->getQuery(true);
        foreach ($list_tour_id as $tour_id) {
            $query->clear()
                ->insert(Utility::getTableName('hotelproperty'))
                ->set('object_id='.(int)$rate_id)
                ->set('type='.$query->quote($key))
                ->set('tour_id='.(int)$tour_id)
            ;
            $db->setQuery($query)->execute();
        }
    }

}