Class ContainerAbstractServiceFactory

Summary

Fully Qualified Name: Zend\Session\Service\ContainerAbstractServiceFactory
Implements: AbstractFactoryInterface

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\sample',
    'my_sample_session_container',
    'MySessionContainer',
),

);

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

Methods

Name Description Defined By
__invoke() Create and return a named container (v3 usage). ContainerAbstractServiceFactory
canCreate() Can we create an instance of the given service? (v3 usage). ContainerAbstractServiceFactory
canCreateServiceWithName() Can we create an instance of the given service? (v2 usage) ContainerAbstractServiceFactory
createServiceWithName() Create and return a named container (v2 usage). ContainerAbstractServiceFactory

Method Details

__invoke()

Create and return a named container (v3 usage).

Parameter Name Type Description
$container \ContainerInterface
$requestedName string
$options

Returns: \Container

canCreate()

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

Parameter Name Type Description
$container \ContainerInterface
$requestedName string

Returns: bool

canCreateServiceWithName()

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

Parameter Name Type Description
$container \ServiceLocatorInterface
$name string
$requestedName string

Returns: bool

createServiceWithName()

Create and return a named container (v2 usage).

Parameter Name Type Description
$container \ContainerInterface
$requestedName string
$name

Returns: \Container

Top