Chris@14: Chris@14: * Chris@14: * For the full copyright and license information, please view the LICENSE Chris@14: * file that was distributed with this source code. Chris@14: */ Chris@14: Chris@14: namespace Symfony\Component\Routing\Loader\Configurator; Chris@14: Chris@14: use Symfony\Component\Routing\RouteCollection; Chris@14: Chris@14: /** Chris@14: * @author Nicolas Grekas Chris@14: */ Chris@14: class ImportConfigurator Chris@14: { Chris@14: use Traits\RouteTrait; Chris@14: Chris@14: private $parent; Chris@14: Chris@14: public function __construct(RouteCollection $parent, RouteCollection $route) Chris@14: { Chris@14: $this->parent = $parent; Chris@14: $this->route = $route; Chris@14: } Chris@14: Chris@14: public function __destruct() Chris@14: { Chris@14: $this->parent->addCollection($this->route); Chris@14: } Chris@14: Chris@14: /** Chris@14: * Sets the prefix to add to the path of all child routes. Chris@14: * Chris@14: * @param string $prefix Chris@14: * Chris@14: * @return $this Chris@14: */ Chris@14: final public function prefix($prefix) Chris@14: { Chris@14: $this->route->addPrefix($prefix); Chris@14: Chris@14: return $this; Chris@14: } Chris@14: }