class LazyRouteCollection in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony-cmf/routing/LazyRouteCollection.php \Symfony\Cmf\Component\Routing\LazyRouteCollection
Hierarchy
- class \Symfony\Component\Routing\RouteCollection implements \Symfony\Component\Routing\IteratorAggregate, \Symfony\Component\Routing\Countable
- class \Symfony\Cmf\Component\Routing\LazyRouteCollection
Expanded class hierarchy of LazyRouteCollection
File
- vendor/
symfony-cmf/ routing/ LazyRouteCollection.php, line 18
Namespace
Symfony\Cmf\Component\RoutingView source
class LazyRouteCollection extends RouteCollection {
/**
* The route provider for this generator.
*
* @var RouteProviderInterface
*/
protected $provider;
public function __construct(RouteProviderInterface $provider) {
$this->provider = $provider;
}
/**
* {@inheritdoc}
*/
public function getIterator() {
return new \ArrayIterator($this
->all());
}
/**
* Gets the number of Routes in this collection.
*
* @return int The number of routes
*/
public function count() {
return count($this
->all());
}
/**
* Returns all routes in this collection.
*
* @return Route[] An array of routes
*/
public function all() {
return $this->provider
->getRoutesByNames(null);
}
/**
* Gets a route by name.
*
* @param string $name The route name
*
* @return Route|null A Route instance or null when not found
*/
public function get($name) {
try {
return $this->provider
->getRouteByName($name);
} catch (RouteNotFoundException $e) {
return null;
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LazyRouteCollection:: |
protected | property | The route provider for this generator. | |
LazyRouteCollection:: |
public | function |
Returns all routes in this collection. Overrides RouteCollection:: |
|
LazyRouteCollection:: |
public | function |
Gets the number of Routes in this collection. Overrides RouteCollection:: |
|
LazyRouteCollection:: |
public | function |
Gets a route by name. Overrides RouteCollection:: |
|
LazyRouteCollection:: |
public | function |
Gets the current RouteCollection as an Iterator that includes all routes. Overrides RouteCollection:: |
|
LazyRouteCollection:: |
public | function | ||
RouteCollection:: |
private | property | ||
RouteCollection:: |
private | property | ||
RouteCollection:: |
public | function | Adds a route. | 1 |
RouteCollection:: |
public | function | Adds a route collection at the end of the current set by appending all routes of the added collection. | 1 |
RouteCollection:: |
public | function | Adds defaults to all routes. | 1 |
RouteCollection:: |
public | function | Adds options to all routes. | 1 |
RouteCollection:: |
public | function | Adds a prefix to the path of all child routes. | 1 |
RouteCollection:: |
public | function | Adds requirements to all routes. | 1 |
RouteCollection:: |
public | function | Adds a resource for this collection. | 1 |
RouteCollection:: |
public | function | Returns an array of resources loaded to build this collection. | 1 |
RouteCollection:: |
public | function | Removes a route or an array of routes by name from the collection. | 1 |
RouteCollection:: |
public | function | Sets a condition on all routes. | |
RouteCollection:: |
public | function | Sets the host pattern on all routes. | 1 |
RouteCollection:: |
public | function | Sets the HTTP methods (e.g. 'POST') all child routes are restricted to. | 1 |
RouteCollection:: |
public | function | Sets the schemes (e.g. 'https') all child routes are restricted to. | 1 |
RouteCollection:: |
public | function | 1 |