|
| __construct (Di $di, $useContainer=self::USE_SL_NONE) |
|
| __invoke (ContainerInterface $container, $name, array $options=null) |
| Create an object.- Parameters
-
ContainerInterface | $container | |
string | $requestedName | |
null | array | $options | |
- Returns
- object
- Exceptions
-
ServiceNotFoundException | if unable to resolve the service. |
ServiceNotCreatedException | if an exception is raised when creating a service. |
ContainerException | if any other error occurs |
|
|
| createService (ServiceLocatorInterface $container, $name=null, $requestedName=null) |
| zend-servicemanager v2 compatibility.
|
|
| setCreationOptions (array $options) |
| zend-servicemanager v2 support for options passed to factory.
|
|
| get ($name, array $params=[]) |
| Override, as we want it to use the functionality defined in the proxy.
|
|
| __construct (DefinitionList $definitions=null, InstanceManager $instanceManager=null, Config $config=null) |
| Constructor.
|
|
| configure (Config $config) |
| Provide a configuration object to configure this instance.
|
|
| setDefinitionList (DefinitionList $definitions) |
|
| definitions () |
|
| setInstanceManager (InstanceManager $instanceManager) |
| Set the instance manager.
|
|
| instanceManager () |
|
| has ($name) |
| Is the DI container capable of returning the named instance?
|
|
| get ($name, array $params=[]) |
| Lazy-load a class.
|
|
| newInstance ($name, array $params=[], $isShared=true) |
| Retrieve a new instance of a class.
|
|
| injectDependencies ($instance, array $params=[]) |
| Inject dependencies.
|
|
| newInstance ($name, array $params=[]) |
| Retrieve a new instance of a class.
|
|
| createService (ServiceLocatorInterface $serviceLocator) |
| Create service.
|
|
|
| getClass ($instance) |
| Utility method used to retrieve the class of a particular instance.
|
|
| getCallParameters ($name, array $params, $method="__construct") |
|
| handleInjectDependencies ($instance, $injectionMethods, $params, $instanceClass, $instanceAlias, $requestedName) |
|
| createInstanceViaConstructor ($class, $params, $alias=null) |
| Retrieve a class instance based on class name.
|
|
| createInstanceViaCallback ($callback, $params, $alias) |
| Get an object instance from the defined callback.
|
|
| resolveAndCallInjectionMethodForInstance ($instance, $method, $params, $alias, $methodRequirementType, $methodClass=null) |
| This parameter will handle any injection methods and resolution of dependencies for such methods.
|
|
| resolveMethodParameters ($class, $method, array $callTimeUserParams, $alias, $methodRequirementType, $isInstantiator=false) |
| Resolve parameters referencing other services.
|
|
static | isSubclassOf ($className, $type) |
| Checks if the object has this class as one of its parents.
|
|
Factory for pulling a service from a DI container.
This factory can be mapped to arbitrary class names, and used to pull them from the composed Di instance, using the following behaviors:
- If USE_SL_BEFORE_DI is passed as the second argument to the constructor, the factory will attempt to fetch the service from the passed container first, and fall back to the composed DI container only on failure.
- If USE_SL_AFTER_DI is passed as the second argument to the constructor, the factory will attempt to fetch the service from the composed DI container first, and fall back to the passed container only on failure.
- If USE_SL_NONE is passed as the second argument to the constructor (or no argument is passed), then the factory will only fetch from the composed DI container.
The DiAbstractServiceFactory extends this class in order to return and/or configure instances.