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

Specialized invokable/abstract factory for use with RoutePluginManager. More...

Public Member Functions

 canCreate (ContainerInterface $container, $routeName)
 Can we create a route instance with the given name? (v3)
 
 canCreateServiceWithName (ServiceLocatorInterface $container, $normalizedName, $routeName)
 Can we create a route instance with the given name? (v2)
 
 __invoke (ContainerInterface $container, $routeName, array $options=null)
 Create and return a RouteInterface instance.
 
 createServiceWithName (ServiceLocatorInterface $container, $normalizedName, $routeName)
 Create a route instance with the given name.
 
 createService (ServiceLocatorInterface $container, $normalizedName=null, $routeName=null)
 Create and return RouteInterface instance.
 
 setCreationOptions (array $creationOptions)
 Set options to use when creating a service (v2)
 
- Public Member Functions inherited from FactoryInterface
 createService (ServiceLocatorInterface $serviceLocator)
 Create service.
 

Protected Attributes

 $creationOptions = []
 

Detailed Description

Specialized invokable/abstract factory for use with RoutePluginManager.

Can be mapped directly to specific route plugin names, or used as an abstract factory to map FQCN services to invokables.

Member Function Documentation

__invoke ( ContainerInterface  $container,
  $routeName,
array  $options = null 
)

Create and return a RouteInterface instance.

If the specified $routeName class does not exist or does not implement RouteInterface, this method will raise an exception.

Otherwise, it uses the class' `factory()` method with the provided $options to produce an instance.

Parameters
ContainerInterface$container
string$routeName
null | array$options
Returns
RouteInterface

Implements FactoryInterface.

canCreate ( ContainerInterface  $container,
  $routeName 
)

Can we create a route instance with the given name? (v3)

Only works for FQCN $routeName values, for classes that implement RouteInterface.

Parameters
ContainerInterface$container
string$routeName
Returns
bool

Implements AbstractFactoryInterface.

canCreateServiceWithName ( ServiceLocatorInterface  $container,
  $normalizedName,
  $routeName 
)

Can we create a route instance with the given name? (v2)

Proxies to canCreate().

Parameters
ServiceLocatorInterface$container
string$normalizedName
string$routeName
Returns
bool

Implements AbstractFactoryInterface.

createService ( ServiceLocatorInterface  $container,
  $normalizedName = null,
  $routeName = null 
)

Create and return RouteInterface instance.

For use with zend-servicemanager v2; proxies to __invoke().

Parameters
ServiceLocatorInterface$container
Returns
RouteInterface
createServiceWithName ( ServiceLocatorInterface  $container,
  $normalizedName,
  $routeName 
)

Create a route instance with the given name.

(v2)

Proxies to __invoke().

Parameters
ServiceLocatorInterface$container
string$normalizedName
string$routeName
Returns
RouteInterface

Implements AbstractFactoryInterface.

setCreationOptions ( array  $creationOptions)

Set options to use when creating a service (v2)

Parameters
array$creationOptions

Member Data Documentation

$creationOptions = []
protected