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

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

}