Methods
Constructor
__construct(\Zend\ServiceManager\ConfigInterface $config)
Sets the given service name as to be handled by a delegator factory
addDelegator(string $serviceName, string $delegatorFactoryName) : \Zend\ServiceManager\ServiceManager
Parameters
$serviceName
string
name of the service being the delegate
$delegatorFactoryName
string
name of the service being the delegator factory
Returns
Add a peering relationship
addPeeringServiceManager(\Zend\ServiceManager\ServiceManager $manager, string $peering) : \Zend\ServiceManager\ServiceManager
Parameters
$peering
string
Returns
Determine if we can create an instance.
canCreate(string | array $name, bool $checkAbstractFactories) : bool
Proxies to has()
deprecated |
this method is being deprecated as of zendframework 2.3, and may be removed in future major versions |
Parameters
$name
stringarray
$checkAbstractFactories
bool
Returns
bool
Determine if we can create an instance from an abstract factory.
canCreateFromAbstractFactory(string $cName, string $rName) : bool
Parameters
$cName
string
$rName
string
Returns
bool
Create an instance of the requested service
create(string | array $name) : bool | object
Parameters
$name
stringarray
Returns
bool
object
Retrieve a registered instance
get(string $name, bool $usePeeringServiceManagers) : object | array
Parameters
$name
string
$usePeeringServiceManagers
bool
Exceptions
Returns
object
array
Get allow override
getAllowOverride() : bool
Retrieve a keyed list of all canonical names.
getCanonicalNames() : array
Handy for debugging!
Returns
array
Retrieve a keyed list of all registered services.
getRegisteredServices() : array
Handy for debugging!
Returns
array
Get throw exceptions in create
getThrowExceptionInCreate() : bool
Determine if an instance exists.
has(string | array $name, bool $checkAbstractFactories, bool $usePeeringServiceManagers) : bool
Parameters
$name
stringarray
An array argument accepts exactly two values. Example: array('canonicalName', 'requestName')
$checkAbstractFactories
bool
$usePeeringServiceManagers
bool
Returns
bool
Determine if we have an alias
hasAlias(string $alias) : bool
Parameters
$alias
string
Returns
bool
isShared()
isShared(string $name) : bool
Parameters
$name
string
Exceptions
Returns
bool
Should we retrieve from the peering manager prior to attempting to create a service?
retrieveFromPeeringManagerFirst() : bool
Allows to override the canonical names lookup map with predefined
values.
setCanonicalNames(array $canonicalNames) : \Zend\ServiceManager\ServiceManager
Parameters
$canonicalNames
array
Returns
Set invokable class
setInvokableClass(string $name, string $invokableClass, bool $shared) : \Zend\ServiceManager\ServiceManager
Parameters
$name
string
$invokableClass
string
$shared
bool
Exceptions
Returns
Set flag indicating whether to pull from peering manager before attempting creation
setRetrieveFromPeeringManagerFirst(bool $retrieveFromPeeringManagerFirst) : \Zend\ServiceManager\ServiceManager
Parameters
$retrieveFromPeeringManagerFirst
bool
Returns
Set flag indicating whether services are shared by default
setShareByDefault(bool $shareByDefault) : \Zend\ServiceManager\ServiceManager
Parameters
$shareByDefault
bool
Exceptions
Returns
Are services shared by default?
shareByDefault() : bool
Canonicalize name
canonicalizeName(string $name) : string
Parameters
$name
string
Returns
string
Ensure the alias definition will not result in a circular reference
checkForCircularAliasReference(string $alias, string $nameOrAlias) : \Zend\ServiceManager\self
Parameters
$alias
string
$nameOrAlias
string
Exceptions
Returns
\Zend\ServiceManager\self
checkNestedContextStart()
checkNestedContextStart(string $cName) : \Zend\ServiceManager\self
Parameters
$cName
string
Returns
\Zend\ServiceManager\self
checkNestedContextStop()
checkNestedContextStop(bool $force) : \Zend\ServiceManager\self
Parameters
$force
bool
Returns
\Zend\ServiceManager\self
createDelegatorFromFactory()
createDelegatorFromFactory($canonicalName, $requestedName) : mixed
Parameters
$canonicalName
$requestedName
Exceptions
Returns
mixed
Attempt to create an instance via an abstract factory
createFromAbstractFactory(string $canonicalName, string $requestedName) : object | null
Parameters
$canonicalName
string
$requestedName
string
Exceptions
Returns
object
null
Attempt to create an instance via a factory
createFromFactory(string $canonicalName, string $requestedName) : mixed
Parameters
$canonicalName
string
$requestedName
string
Exceptions
Returns
mixed
Attempt to create an instance via an invokable class
createFromInvokable(string $canonicalName, string $requestedName) : null | \stdClass
Parameters
$canonicalName
string
$requestedName
string
Exceptions
Returns
Create service via callback
createServiceViaCallback(\Zend\ServiceManager\callable $callable, string $cName, string $rName) : object
Parameters
$callable
\Zend\ServiceManager\callable
$cName
string
$rName
string
Exceptions
Returns
object
Checks if the object has this class as one of its parents
isSubclassOf(string $className, string $type) : bool
see |
\Zend\ServiceManager\https://bugs.php.net/bug.php?id=53727 |
see |
\Zend\ServiceManager\https://github.com/zendframework/zf2/pull/1807 |
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
bool
Loop over peering service managers.
loopPeeringServiceManagers(string $name) : mixed
Parameters
$name
string
Returns
mixed
Resolve the alias for the given canonical name
resolveAlias(string $cName) : string
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
Parameters
$name
string
Returns
mixed
Unregister a service
unregisterService(string $canonical) : void
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 | \Zend\ServiceManager\callable $delegatorFactory, string $rName, string $cName, \Zend\ServiceManager\callable $creationCallback) : \Zend\ServiceManager\callable
Parameters
$rName
string
requested service name
$cName
string
canonical service name
$creationCallback
\Zend\ServiceManager\callable
callback for instantiating the real service
Returns
\Zend\ServiceManager\callable
Properties
$aliases
$aliases : array
$allowOverride
$allowOverride : bool
Lookup for canonicalized names.
$canonicalNames : array
<p>map of characters to be replaced through strtr</p>
$canonicalNamesReplacements : array
$delegators
$delegators : array[]
$initializers
$initializers : array
Registered services and cached values
$instances : array
$invokableClasses
$invokableClasses : array
$nestedContext
$nestedContext : array
$nestedContextCounter
$nestedContextCounter : integer
$pendingAbstractFactoryRequests
$pendingAbstractFactoryRequests : array
$retrieveFromPeeringManagerFirst
$retrieveFromPeeringManagerFirst : bool
Whether or not to share by default
$shareByDefault : bool
<p>Track whether not to throw exceptions during create()</p>
$throwExceptionInCreate : bool
Constants
SCOPE_PARENT
SCOPE_PARENT