<?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 TourOperatorProFrontend\app;

use TourOperatorPro\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['tour_id']) && !empty($query['tour_id'])){
            $tour_id=$query['tour_id'];
            $modelTour=Model::getInstance('tour');
            $tour=$modelTour->getItem($tour_id);
            $alias=$tour->alias;
            $id=$tour->id;
            $parts[]="$alias-$id";
            unset($query['tour_id']);
        }
        return $parts;
    }

}