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

Session container abstract service factory. More...

Public Member Functions

 canCreate (ContainerInterface $container, $requestedName)
 Can we create an instance of the given service? (v3 usage).
 
 canCreateServiceWithName (ServiceLocatorInterface $container, $name, $requestedName)
 Can we create an instance of the given service? (v2 usage)
 
 __invoke (ContainerInterface $container, $requestedName, array $options=null)
 Create and return a named container (v3 usage).
 
 createServiceWithName (ServiceLocatorInterface $container, $name, $requestedName)
 Create and return a named container (v2 usage).
 

Protected Member Functions

 getConfig (ContainerInterface $container)
 Retrieve config from service locator, and cache for later.
 
 getSessionManager (ContainerInterface $container)
 Retrieve the session manager instance, if any.
 
 normalizeContainerName ($name)
 Normalize the container name in order to perform a lookup.
 

Protected Attributes

 $config
 
 $configKey = 'session_containers'
 
 $sessionManager
 

Detailed Description

Session container abstract service factory.

Allows creating Container instances, using the ManagerInterface if present. Containers are named in a "session_containers" array in the Config service:

return array( 'session_containers' => array( 'SessionContainer', 'my_sample_session_container', 'MySessionContainer', ), );

$container = $services->get('MySessionContainer');

Member Function Documentation

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

Create and return a named container (v3 usage).

Parameters
ContainerInterface$container
string$requestedName
Returns
Container

Implements FactoryInterface.

canCreate ( ContainerInterface  $container,
  $requestedName 
)

Can we create an instance of the given service? (v3 usage).

Parameters
ContainerInterface$container
string$requestedName
Returns
bool

Implements AbstractFactoryInterface.

canCreateServiceWithName ( ServiceLocatorInterface  $container,
  $name,
  $requestedName 
)

Can we create an instance of the given service? (v2 usage)

Parameters
ServiceLocatorInterface$container
string$name
string$requestedName
Returns
bool

Implements AbstractFactoryInterface.

createServiceWithName ( ServiceLocatorInterface  $container,
  $name,
  $requestedName 
)

Create and return a named container (v2 usage).

Parameters
ContainerInterface$container
string$requestedName
Returns
Container

Implements AbstractFactoryInterface.

getConfig ( ContainerInterface  $container)
protected

Retrieve config from service locator, and cache for later.

Parameters
ContainerInterface$container
Returns
false|array
getSessionManager ( ContainerInterface  $container)
protected

Retrieve the session manager instance, if any.

Parameters
ContainerInterface$container
Returns
null|ManagerInterface
normalizeContainerName (   $name)
protected

Normalize the container name in order to perform a lookup.

Parameters
string$name
Returns
string

Member Data Documentation

$config
protected
$configKey = 'session_containers'
protected
$sessionManager
protected