<?php
namespace WpBookingHotelAdmin\app\helpers;

use WpBookingHotel\Factory;
use WpBookingHotel\Utilities\Utility;

class TagHelper
{
    public static function getWpBookingTagKey(){
        return 'tag';
    }
    public static function insertNewPropertyByKey($key='', $list_hotel_id=array(), $tag_id=0) {
        $db = Factory::getDBO();
        $query =$db->getQuery(true);
        foreach ($list_hotel_id as $hotel_id) {
            $query->clear()
                ->insert(Utility::getTableName('hotelproperty'))
                ->set('object_id='.(int)$tag_id)
                ->set('type='.$query->quote($key))
                ->set('hotel_id='.(int)$hotel_id)
            ;
            $db->setQuery($query)->execute();
        }
    }

}