<?php
namespace TourOperatorProAdmin\app\helpers;

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

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

}