Interface AbstractFactoryInterface

Summary

Fully Qualified Name: Zend\ServiceManager\AbstractFactoryInterface
Extends: AbstractFactoryInterface

Description

Backwards-compatibility shim for AbstractFactoryInterface.

Implementations should update to implement only Zend\ServiceManager\Factory\AbstractFactoryInterface.

If upgrading from v2, take the following steps:

Once you have tested your code, you can then update your class to only implement Zend\ServiceManager\Factory\AbstractFactoryInterface, and remove the canCreateServiceWithName() and createServiceWithName() methods.

Methods

Name Description Defined By
__invoke() Create an object FactoryInterface
canCreate() Can the factory create an instance for the service? AbstractFactoryInterface
canCreateServiceWithName() Determine if we can create a service with name AbstractFactoryInterface
createServiceWithName() Create service with name AbstractFactoryInterface

Method Details

__invoke()

Create an object

Parameter Name Type Description
$container \ContainerInterface
$requestedName string
$options null|array

Returns: object

canCreate()

Can the factory create an instance for the service?

Parameter Name Type Description
$container \ContainerInterface
$requestedName string

Returns: bool

canCreateServiceWithName()

Determine if we can create a service with name

Parameter Name Type Description
$serviceLocator \ServiceLocatorInterface
$requestedName
$name
$requestedName

Returns: bool

createServiceWithName()

Create service with name

Parameter Name Type Description
$serviceLocator \ServiceLocatorInterface
$requestedName
$name
$requestedName

Returns: mixed

Top