From 2834e7ef21b9f6e9d9d1e6beeb1b0a2bd77f5f7e Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Thu, 15 Nov 2012 12:26:47 +0100 Subject: [PATCH] added scheme and method setter in RouteCollection --- .../Component/Routing/RouteCollection.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Symfony/Component/Routing/RouteCollection.php b/src/Symfony/Component/Routing/RouteCollection.php index 4df6f7d145..af14134c65 100644 --- a/src/Symfony/Component/Routing/RouteCollection.php +++ b/src/Symfony/Component/Routing/RouteCollection.php @@ -318,6 +318,30 @@ class RouteCollection implements \IteratorAggregate, \Countable } } + /** + * Sets the schemes (e.g. 'https') all child routes are restricted to. + * + * @param string|array $schemes The scheme or an array of schemes + */ + public function setSchemes($schemes) + { + foreach ($this->routes as $route) { + $route->setSchemes($schemes); + } + } + + /** + * Sets the HTTP methods (e.g. 'POST') all child routes are restricted to. + * + * @param string|array $methods The method or an array of methods + */ + public function setMethods($methods) + { + foreach ($this->routes as $route) { + $route->setMethods($methods); + } + } + /** * Returns an array of resources loaded to build this collection. *