Plugin manager implementation for hydrators.
Enforces that adapters retrieved are instances of HydratorInterface
package |
Default |
inherited_from |
\Zend\ServiceManager\AbstractPluginManager |
Methods
Constructor
__construct(\Zend\ServiceManager\ConfigInterface $config = null
)
Inherited
Parameters
$config
\Zend\ServiceManager\ConfigInterface
Add abstract factory
addAbstractFactory(\Zend\ServiceManager\AbstractFactoryInterface|string $factory, boolean $topOfStack = true
) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$factory
\Zend\ServiceManager\AbstractFactoryInterface
string
$topOfStack
boolean
Exceptions
\Zend\ServiceManager\Exception\InvalidArgumentException |
if the abstract factory is invalid |
Returns
\Zend\ServiceManager\ServiceManager
Sets the given service name as to be handled by a delegator factory
addDelegator(string $serviceName, string $delegatorFactoryName) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$serviceName
string
name of the service being the delegate
$delegatorFactoryName
string
name of the service being the delegator factory
Returns
\Zend\ServiceManager\ServiceManager
Add initializer
addInitializer(callable|\Zend\ServiceManager\InitializerInterface $initializer, boolean $topOfStack = true
) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$initializer
callable
\Zend\ServiceManager\InitializerInterface
$topOfStack
boolean
Exceptions
\Zend\ServiceManager\Exception\InvalidArgumentException |
|
Returns
\Zend\ServiceManager\ServiceManager
Add a peering relationship
addPeeringServiceManager(\Zend\ServiceManager\ServiceManager $manager, string $peering = self::SCOPE_PARENT
) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$manager
\Zend\ServiceManager\ServiceManager
$peering
string
Returns
\Zend\ServiceManager\ServiceManager
Determine if we can create an instance.
canCreate(string|array $name, boolean $checkAbstractFactories = true
) : boolean
Inherited
deprecated |
this method is being deprecated as of zendframework 2.3, and may be removed in future major versions |
Parameters
$name
string
array
$checkAbstractFactories
boolean
Returns
boolean
Determine if we can create an instance from an abstract factory.
canCreateFromAbstractFactory(string $cName, string $rName) : boolean
Inherited
Parameters
$cName
string
$rName
string
Returns
boolean
Create an instance of the requested service
create(string|array $name) : boolean | object
Inherited
Parameters
$name
string
array
Returns
boolean
object
Create scoped service manager
createScopedServiceManager(string $peering = self::SCOPE_PARENT
) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$peering
string
Returns
\Zend\ServiceManager\ServiceManager
Retrieve a registered instance
get(string $name, boolean $usePeeringServiceManagers = true
) : object | array
Inherited
inherited_from |
\Zend\ServiceManager\ServiceLocatorInterface::get() |
Parameters
$name
string
$usePeeringServiceManagers
boolean
Exceptions
\Zend\ServiceManager\Exception\ServiceNotFoundException |
|
Returns
object
array
Get allow override
getAllowOverride() : boolean
Inherited
Retrieve a keyed list of all canonical names. Handy for debugging!
getCanonicalNames() : array
Inherited
Retrieve a keyed list of all registered services. Handy for debugging!
getRegisteredServices() : array
Inherited
Get the main plugin manager. Useful for fetching dependencies from within factories.
getServiceLocator() : \Zend\ServiceManager\ServiceLocatorInterface
Inherited
inherited_from |
\Zend\ServiceManager\ServiceLocatorAwareInterface::getServiceLocator() |
Returns
\Zend\ServiceManager\ServiceLocatorInterface
Get throw exceptions in create
getThrowExceptionInCreate() : boolean
Inherited
Determine if an instance exists.
has(string|array $name, boolean $checkAbstractFactories = true
, boolean $usePeeringServiceManagers = true
) : boolean
Inherited
inherited_from |
\Zend\ServiceManager\ServiceLocatorInterface::has() |
Parameters
$name
string
array
An array argument accepts exactly two values.
Example: array('canonicalName', 'requestName')
$checkAbstractFactories
boolean
$usePeeringServiceManagers
boolean
Returns
boolean
Determine if we have an alias
hasAlias(string $alias) : boolean
Inherited
Parameters
$alias
string
Returns
boolean
isShared()
isShared(string $name) : boolean
Inherited
Parameters
$name
string
Exceptions
\Zend\ServiceManager\Exception\ServiceNotFoundException |
|
Returns
boolean
Should we retrieve from the peering manager prior to attempting to create a service?
retrieveFromPeeringManagerFirst() : boolean
Inherited
setAlias()
setAlias(string $alias, string $nameOrAlias) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$alias
string
$nameOrAlias
string
Exceptions
\Zend\ServiceManager\Exception\ServiceNotFoundException |
|
\Zend\ServiceManager\Exception\InvalidServiceNameException |
|
Returns
\Zend\ServiceManager\ServiceManager
Set allow override
setAllowOverride($allowOverride) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$allowOverride
Returns
\Zend\ServiceManager\ServiceManager
Allows to override the canonical names lookup map with predefined
values.
setCanonicalNames(array $canonicalNames) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$canonicalNames
array
Returns
\Zend\ServiceManager\ServiceManager
Set factory
setFactory(string $name, string|\Zend\ServiceManager\FactoryInterface|callable $factory, boolean $shared = null
) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$name
string
$factory
string
\Zend\ServiceManager\FactoryInterface
callable
$shared
boolean
Exceptions
\Zend\ServiceManager\Exception\InvalidArgumentException |
|
\Zend\ServiceManager\Exception\InvalidServiceNameException |
|
Returns
\Zend\ServiceManager\ServiceManager
Set invokable class
setInvokableClass(string $name, string $invokableClass, boolean $shared = null
) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$name
string
$invokableClass
string
$shared
boolean
Exceptions
\Zend\ServiceManager\Exception\InvalidServiceNameException |
|
Returns
\Zend\ServiceManager\ServiceManager
Set flag indicating whether to pull from peering manager before attempting creation
setRetrieveFromPeeringManagerFirst(boolean $retrieveFromPeeringManagerFirst = true
) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$retrieveFromPeeringManagerFirst
boolean
Returns
\Zend\ServiceManager\ServiceManager
Register a service with the locator
setService(string $name, mixed $service) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$name
string
$service
mixed
Exceptions
\Zend\ServiceManager\Exception\InvalidServiceNameException |
|
Returns
\Zend\ServiceManager\ServiceManager
Set the main service locator so factories can have access to it to pull deps
setServiceLocator(\Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) : \Zend\ServiceManager\AbstractPluginManager
Inherited
inherited_from |
\Zend\ServiceManager\ServiceLocatorAwareInterface::setServiceLocator() |
Parameters
$serviceLocator
\Zend\ServiceManager\ServiceLocatorInterface
Returns
\Zend\ServiceManager\AbstractPluginManager
Set flag indicating whether services are shared by default
setShareByDefault(boolean $shareByDefault) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$shareByDefault
boolean
Exceptions
\Zend\ServiceManager\Exception\RuntimeException |
if allowOverride is false |
Returns
\Zend\ServiceManager\ServiceManager
setShared()
setShared(string $name, boolean $isShared) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$name
string
$isShared
boolean
Exceptions
\Zend\ServiceManager\Exception\ServiceNotFoundException |
|
Returns
\Zend\ServiceManager\ServiceManager
Set throw exceptions in create
setThrowExceptionInCreate(boolean $throwExceptionInCreate) : \Zend\ServiceManager\ServiceManager
Inherited
Parameters
$throwExceptionInCreate
boolean
Returns
\Zend\ServiceManager\ServiceManager
Are services shared by default?
shareByDefault() : boolean
Inherited
Validate the plugin
validatePlugin(mixed $plugin)
Checks that the filter loaded is either a valid callback or an instance
of FilterInterface.
inherited_from |
\Zend\ServiceManager\AbstractPluginManager::validatePlugin() |
Parameters
$plugin
Validate the plugin
validatePlugin(mixed $plugin) : void
Inherited
Checks that the filter loaded is either a valid callback or an instance
of FilterInterface.
Parameters
$plugin
mixed
Exceptions
\Zend\ServiceManager\Exception\RuntimeException |
if invalid |
Canonicalize name
canonicalizeName(string $name) : string
Inherited
Parameters
$name
string
Returns
string
Ensure the alias definition will not result in a circular reference
checkForCircularAliasReference(string $alias, string $nameOrAlias) : \Zend\Stdlib\Hydrator\HydratorPluginManager
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$alias
string
$nameOrAlias
string
Exceptions
\Zend\ServiceManager\Exception\CircularReferenceException |
|
Returns
\Zend\Stdlib\Hydrator\HydratorPluginManager
checkNestedContextStart()
checkNestedContextStart(string $cName) : \Zend\Stdlib\Hydrator\HydratorPluginManager
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$cName
string
Returns
\Zend\Stdlib\Hydrator\HydratorPluginManager
checkNestedContextStop()
checkNestedContextStop(boolean $force = false
) : \Zend\Stdlib\Hydrator\HydratorPluginManager
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$force
boolean
Returns
\Zend\Stdlib\Hydrator\HydratorPluginManager
createDelegatorFromFactory()
createDelegatorFromFactory($canonicalName, $requestedName) : mixed
Inherited
Parameters
$canonicalName
$requestedName
Exceptions
\Zend\ServiceManager\Exception\ServiceNotCreatedException |
|
Returns
mixed
Attempt to create an instance via an abstract factory
createFromAbstractFactory(string $canonicalName, string $requestedName) : object | null
Inherited
Parameters
$canonicalName
string
$requestedName
string
Exceptions
\Zend\ServiceManager\Exception\ServiceNotCreatedException |
If abstract factory is not callable |
Returns
object
null
Attempt to create an instance via a factory
createFromFactory(string $canonicalName, string $requestedName) : mixed
Inherited
Parameters
$canonicalName
string
$requestedName
string
Exceptions
\Zend\ServiceManager\Exception\ServiceNotCreatedException |
If factory is not callable |
Returns
mixed
Attempt to create an instance via an invokable class
createFromInvokable(string $canonicalName, string $requestedName) : null | \stdClass
Inherited
Parameters
$canonicalName
string
$requestedName
string
Exceptions
\Zend\ServiceManager\Exception\ServiceNotFoundException |
If resolved class does not exist |
Returns
null
\stdClass
Create service via callback
createServiceViaCallback(callable $callable, string $cName, string $rName) : object
Inherited
Parameters
$callable
callable
$cName
string
$rName
string
Exceptions
\Zend\ServiceManager\Exception\ServiceNotCreatedException |
|
\Zend\ServiceManager\Exception\ServiceNotFoundException |
|
\Zend\ServiceManager\Exception\CircularDependencyFoundException |
|
Returns
object
Checks if the object has this class as one of its parents
isSubclassOf(string $className, string $type) : boolean
InheritedStatic
see |
|
see |
|
deprecated |
since zf 2.3 requires PHP >= 5.3.23 |
deprecated |
this method is being deprecated as of zendframework 2.2, and may be removed in future major versions |
Parameters
$className
string
$type
string
Returns
boolean
Loop over peering service managers.
loopPeeringServiceManagers(string $name) : mixed
Inherited
Parameters
$name
string
Returns
mixed
Resolve the alias for the given canonical name
resolveAlias(string $cName) : string
Inherited
Parameters
$cName
string
The canonical name to resolve
Returns
string
The resolved canonical name
Attempt to retrieve an instance via a peering manager
retrieveFromPeeringManager(string $name) : mixed
Inherited
Parameters
$name
string
Returns
mixed
Unregister a service
unregisterService(string $canonical) : void
Inherited
Called when $allowOverride is true and we detect that a service being
added to the instance already exists. This will remove the duplicate
entry, and also any shared flags previously registered.
Parameters
$canonical
string
Creates a callback that uses a delegator to create a service
createDelegatorCallback(\Zend\ServiceManager\DelegatorFactoryInterface|callable $delegatorFactory, string $rName, string $cName, callable $creationCallback) : callable
Inherited
Parameters
$delegatorFactory
\Zend\ServiceManager\DelegatorFactoryInterface
callable
the delegator factory
$rName
string
requested service name
$cName
string
canonical service name
$creationCallback
callable
callback for instantiating the real service
Returns
callable
tryThrowingServiceLocatorUsageException()
tryThrowingServiceLocatorUsageException(string $serviceName, boolean $isAutoInvokable, \Exception $exception)
Inherited
Parameters
$serviceName
string
$isAutoInvokable
boolean
$exception
\Exception
Exceptions
\Exception |
|
\Zend\ServiceManager\Exception\ServiceLocatorUsageException |
|
Properties
$abstractFactories
$abstractFactories : array<mixed,\Zend\ServiceManager\AbstractFactoryInterface>
Default aliases
$aliases : array
Default
array('delegatinghydrator' => 'Zend\Stdlib\Hydrator\DelegatingHydrator')
$aliases
$aliases : array
$allowOverride
$allowOverride : boolean
Whether or not to auto-add a class as an invokable class if it exists
$autoAddInvokableClass : boolean
Lookup for canonicalized names.
$canonicalNames : array
map of characters to be replaced through strtr
$canonicalNamesReplacements : array
Default
array('-' => '', '_' => '', ' ' => '', '\\' => '', '/' => '')
Options to use when creating an instance
$creationOptions : mixed
$delegators
$delegators : array<mixed,array>
Default factory-based adapters
$factories : array
Default
array('Zend\Stdlib\Hydrator\DelegatingHydrator' => 'Zend\Stdlib\Hydrator\DelegatingHydratorFactory')
$factories
$factories : string | callable | \Closure | array<mixed,\Zend\ServiceManager\FactoryInterface>
$initializers
$initializers : array
Registered services and cached values
$instances : array
Default set of adapters
$invokableClasses : array
Default
array('arrayserializable' => 'Zend\Stdlib\Hydrator\ArraySerializable', 'classmethods' => 'Zend\Stdlib\Hydrator\ClassMethods', 'objectproperty' => 'Zend\Stdlib\Hydrator\ObjectProperty', 'reflection' => 'Zend\Stdlib\Hydrator\Reflection')
$invokableClasses
$invokableClasses : array
$nestedContext
$nestedContext : array
$nestedContextCounter
$nestedContextCounter : integer
$peeringServiceManagers
$peeringServiceManagers : array<mixed,\Zend\ServiceManager\ServiceManager>
$pendingAbstractFactoryRequests
$pendingAbstractFactoryRequests : array
$retrieveFromPeeringManagerFirst
$retrieveFromPeeringManagerFirst : boolean
The main service locator
$serviceLocator : \Zend\ServiceManager\ServiceLocatorInterface
$serviceManagerCaller
$serviceManagerCaller : \Zend\ServiceManager\ServiceLocatorInterface
Whether or not to share by default
$shareByDefault : boolean
Whether or not to share by default
$shareByDefault : boolean
Track whether not to throw exceptions during create()
$throwExceptionInCreate : boolean
Constants
SCOPE_CHILD
SCOPE_CHILD = 'child'
SCOPE_PARENT
SCOPE_PARENT = 'parent'