<?php
/**
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace WpBookingHotelFrontend\app;

use WpBookingHotel\Mvc\Model\Model;

/**
 * Routing class of com_content
 *
 * @since  3.3
 */
class router extends RouterView
{
    protected $noIDs = false;

    public function __construct($app = null, $menu = null)
    {

    }
    public function build( &$query )
    {
        $parts=[];
        if(isset($query['hotel_id']) && !empty($query['hotel_id'])){
            $hotel_id=$query['hotel_id'];
            $modelhotel=Model::getInstance('hotel');
            $hotel=$modelhotel->getItem($hotel_id);
            $alias=$hotel->alias;
            $id=$hotel->id;
            $parts[]="$alias-$id";
            unset($query['hotel_id']);
        }
        return $parts;
    }

}