FileAccess Orion

AbstractFactoryInterface extends FactoryInterface

Interface for an abstract factory.

An abstract factory extends the factory interface, but also has an additional "canCreate" method, which is called to check if the abstract factory has the ability to create an instance for the given service. You should limit the number of abstract factories to ensure good performance. Starting from ServiceManager v3, remember that you can also attach multiple names to the same factory, which reduces the need for abstract factories.

Table of Contents

__invoke()  : object
Create an object
canCreate()  : bool
Can the factory create an instance for the service?

Methods

__invoke()

Create an object

public __invoke(ContainerInterface $container, string $requestedName[, null|array<string|int, mixed> $options = null ]) : object
Parameters
$container : ContainerInterface
$requestedName : string
$options : null|array<string|int, mixed> = null
Tags
throws
ServiceNotFoundException

if unable to resolve the service.

throws
ServiceNotCreatedException

if an exception is raised when creating a service.

throws
ContainerException

if any other error occurs

Return values
object

Search results