Zend Framework  3.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RoutePluginManager Class Reference

Plugin manager implementation for routes. More...

Public Member Functions

 __construct ($configOrContainerInstance, array $v3config=[])
 Constructor.
 
 validate ($plugin)
 Validate a route plugin.
 
 validatePlugin ($plugin)
 Validate a route plugin.
 
 configure (array $config)
 Pre-process configuration.
 
- Public Member Functions inherited from AbstractPluginManager
 __construct ($configInstanceOrParentLocator=null, array $config=[])
 Constructor.
 
 configure (array $config)
 Override configure() to validate service instances.
 
 get ($name, array $options=null)
 
 
 validate ($instance)
 Validate an instance.
Parameters
object$instance
Returns
void
Exceptions
InvalidServiceExceptionIf created instance does not respect the constraint on type imposed by the plugin manager
ContainerExceptionif any other error occurs

 
 setServiceLocator (ContainerInterface $container)
 Implemented for backwards compatibility only.
 
- Public Member Functions inherited from ServiceManager
 __construct (array $config=[])
 Constructor.
 
 getServiceLocator ()
 Implemented for backwards compatibility with previous plugin managers only.
 
 get ($name)
 
 
 build ($name, array $options=null)
 Build a service by its name, using optional options (such services are NEVER cached).
Parameters
string$name
null | array$options
Returns
mixed
Exceptions
Exception\ServiceNotFoundExceptionIf no factory/abstract factory could be found to create the instance.
Exception\ServiceNotCreatedExceptionIf factory/delegator fails to create the instance.
ContainerExceptionif any other error occurs

 
 has ($name)
 
 
 setAllowOverride ($flag)
 Indicate whether or not the instance is immutable.
 
 getAllowOverride ()
 Retrieve the flag indicating immutability status.
 
 configure (array $config)
 Configure the service manager.
 
 setAlias ($alias, $target)
 Add an alias.
 
 setInvokableClass ($name, $class=null)
 Add an invokable class mapping.
 
 setFactory ($name, $factory)
 Specify a factory for a given service name.
 
 mapLazyService ($name, $class=null)
 Create a lazy service mapping to a class.
 
 addAbstractFactory ($factory)
 Add an abstract factory for resolving services.
 
 addDelegator ($name, $factory)
 Add a delegator for a given service.
 
 addInitializer ($initializer)
 Add an initializer.
 
 setService ($name, $service)
 Map a service.
 
 setShared ($name, $flag)
 Add a service sharing rule.
 

Protected Member Functions

 createAliasesForInvokables (array $invokables)
 Create aliases for invokable classes.
 
 createFactoriesForInvokables (array $invokables)
 Create invokable factories for invokable classes.
 

Protected Attributes

 $instanceOf = RouteInterface::class
 
 $shareByDefault = false
 
 $sharedByDefault = false
 
- Protected Attributes inherited from AbstractPluginManager
 $autoAddInvokableClass = true
 
 $instanceOf = null
 
- Protected Attributes inherited from ServiceManager
 $abstractFactories = []
 
 $aliases = []
 
 $allowOverride = false
 Whether or not changes may be made to this instance.
 
 $creationContext
 
 $delegators = []
 
 $factories = []
 
 $initializers = []
 
 $lazyServices = []
 
 $services = []
 
 $shared = []
 
 $sharedByDefault = true
 
 $configured = false
 

Detailed Description

Plugin manager implementation for routes.

Enforces that routes retrieved are instances of RouteInterface. It overrides configure() to map invokables to the component-specific RouteInvokableFactory.

The manager is marked to not share by default, in order to allow multiple route instances of the same type.

Constructor & Destructor Documentation

__construct (   $configOrContainerInstance,
array  $v3config = [] 
)

Constructor.

Ensure that the instance is seeded with the RouteInvokableFactory as an abstract factory.

Parameters
ContainerInterface | \Zend\ServiceManager\ConfigInterface$configOrContainerInstance
array$v3config

Member Function Documentation

configure ( array  $config)

Pre-process configuration.

(v3)

Checks for invokables, and, if found, maps them to the component-specific RouteInvokableFactory; removes the invokables entry before passing to the parent.

Parameters
array$config
Returns
void
createAliasesForInvokables ( array  $invokables)
protected

Create aliases for invokable classes.

If an invokable service name does not match the class it maps to, this creates an alias to the class (which will later be mapped as an invokable factory).

Parameters
array$invokables
Returns
array
createFactoriesForInvokables ( array  $invokables)
protected

Create invokable factories for invokable classes.

If an invokable service name does not match the class it maps to, this creates an invokable factory entry for the class name; otherwise, it creates an invokable factory for the entry name.

Parameters
array$invokables
Returns
array
validate (   $plugin)

Validate a route plugin.

(v2)

Parameters
object$plugin
Exceptions
InvalidServiceException

Implements PluginManagerInterface.

validatePlugin (   $plugin)

Validate a route plugin.

(v2)

Parameters
object$plugin
Exceptions
Exception\RuntimeException

Member Data Documentation

$instanceOf = RouteInterface::class
protected
$shareByDefault = false
protected
$sharedByDefault = false
protected