Registry of instantiated objects, their names and the parameters used to build them

package Zend_Di

 Methods

Constructor

__construct(\Zend\Di\InstanceManager $diInstanceManager, \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) 

Parameters

$diInstanceManager

\Zend\Di\InstanceManager

Add alias

addAlias(string $alias, string $class, array $parameters) : void
Inherited

inherited_from \Zend\Di\InstanceManager::addAlias()

Parameters

$alias

string

$class

string

$parameters

array

Exceptions

\Zend\Di\Exception\InvalidArgumentException

Add shared instance

addSharedInstance(object $instance, string $classOrAlias) 
Inherited

inherited_from \Zend\Di\InstanceManager::addSharedInstance()

Parameters

$instance

object

$classOrAlias

string

Exceptions

\Zend\Di\Exception\InvalidArgumentException

addSharedInstanceWithParameters()

addSharedInstanceWithParameters(object $instance, string $classOrAlias, array $params) : void
Inherited

inherited_from \Zend\Di\InstanceManager::addSharedInstanceWithParameters()

Parameters

$instance

object

$classOrAlias

string

$params

array

Adds a type preference.

addTypePreference(string $interfaceOrAbstract, string $preferredImplementation) : \Zend\Di\self
Inherited

A type preference is a redirection to a preferred alias or type when an abstract type $interfaceOrAbstract is requested

inherited_from \Zend\Di\InstanceManager::addTypePreference()

Parameters

$interfaceOrAbstract

string

$preferredImplementation

string

Returns

\Zend\Di\self

Get aliases

getAliases() : array
Inherited

inherited_from \Zend\Di\InstanceManager::getAliases()

Returns

array

getClassFromAlias()

getClassFromAlias($alias) : string | bool
Inherited

inherited_from \Zend\Di\InstanceManager::getClassFromAlias()

Parameters

$alias

string

Exceptions

\Zend\Di\Exception\RuntimeException

Returns

stringbool

Get classes

getClasses() : array
Inherited

inherited_from \Zend\Di\InstanceManager::getClasses()

Returns

array

getConfig()

getConfig(string $aliasOrClass) : array
Inherited

inherited_from \Zend\Di\InstanceManager::getConfig()

Parameters

$aliasOrClass

string

Returns

array

Get shared instance

getSharedInstance($classOrAlias) : mixed

Parameters

$classOrAlias

Returns

mixed

Retrieves an instance by its name and the parameters stored at its instantiation

getSharedInstanceWithParameters(string $classOrAlias, array $params, bool | null $fastHashFromHasLookup) : object | bool
Inherited

inherited_from \Zend\Di\InstanceManager::getSharedInstanceWithParameters()

Parameters

$classOrAlias

string

$params

array

$fastHashFromHasLookup

boolnull

Returns

objectboolfalse if no instance was found

Get type preferences

getTypePreferences(string $interfaceOrAbstract) : array
Inherited

inherited_from \Zend\Di\InstanceManager::getTypePreferences()

Parameters

$interfaceOrAbstract

string

Returns

array

Check for an alias

hasAlias(string $alias) : bool
Inherited

inherited_from \Zend\Di\InstanceManager::hasAlias()

Parameters

$alias

string

Returns

bool

Check for configuration

hasConfig(string $aliasOrClass) : bool
Inherited

inherited_from \Zend\Di\InstanceManager::hasConfig()

Parameters

$aliasOrClass

string

Returns

bool

Determine if we have a shared instance by class or alias

hasSharedInstance($classOrAlias) : bool

Parameters

$classOrAlias

Returns

bool

hasSharedInstanceWithParameters()

hasSharedInstanceWithParameters(string $classOrAlias, array $params, bool $returnFastHashLookupKey) : bool | string
Inherited

inherited_from \Zend\Di\InstanceManager::hasSharedInstanceWithParameters()

Parameters

$classOrAlias

string

$params

array

$returnFastHashLookupKey

bool

Returns

boolstring

Check for type preferences

hasTypePreferences(string $interfaceOrAbstract) : bool
Inherited

inherited_from \Zend\Di\InstanceManager::hasTypePreferences()

Parameters

$interfaceOrAbstract

string

Returns

bool

Removes a previously set type preference

removeTypePreference(string $interfaceOrAbstract, string $preferredType) : bool | \Zend\Di\self
Inherited

inherited_from \Zend\Di\InstanceManager::removeTypePreference()

Parameters

$interfaceOrAbstract

string

$preferredType

string

Returns

bool\Zend\Di\self

Sets configuration for a single alias/class

setConfig(string $aliasOrClass, array $configuration, bool $append) 
Inherited

inherited_from \Zend\Di\InstanceManager::setConfig()

Parameters

$aliasOrClass

string

$configuration

array

$append

bool

setInjections() is a convenience method for: setConfig($type, array('injections' => array(.

setInjections(string $aliasOrClass, array $injections) : void
Inherited

..)), true);

inherited_from \Zend\Di\InstanceManager::setInjections()

Parameters

$aliasOrClass

string

Alias or Class

$injections

array

Multi-dim array of methods and their parameters

setParameters() is a convenience method for: setConfig($type, array('parameters' => array(.

setParameters(string $aliasOrClass, array $parameters) : void
Inherited

..)), true);

inherited_from \Zend\Di\InstanceManager::setParameters()

Parameters

$aliasOrClass

string

Alias or Class

$parameters

array

Multi-dim array of parameters and their values

Set shared

setShared(string $aliasOrClass, bool $isShared) : void
Inherited

inherited_from \Zend\Di\InstanceManager::setShared()

Parameters

$aliasOrClass

string

$isShared

bool

Set type preference

setTypePreference(string $interfaceOrAbstract, array $preferredImplementations) : \Zend\Di\InstanceManager
Inherited

inherited_from \Zend\Di\InstanceManager::setTypePreference()

Parameters

$interfaceOrAbstract

string

$preferredImplementations

array

Returns

Unset type preferences

unsetTypePreferences(string $interfaceOrAbstract) : void
Inherited

inherited_from \Zend\Di\InstanceManager::unsetTypePreferences()

Parameters

$interfaceOrAbstract

string

createHashForKeys()

createHashForKeys(string $classOrAlias, string[] $paramKeys) : string
Inherited

inherited_from \Zend\Di\InstanceManager::createHashForKeys()

Parameters

$classOrAlias

string

$paramKeys

string[]

Returns

string

createHashForValues()

createHashForValues(string $classOrAlias, array $paramValues) : string
Inherited

inherited_from \Zend\Di\InstanceManager::createHashForValues()

Parameters

$classOrAlias

string

$paramValues

array

Returns

string

getBaseAlias()

getBaseAlias(string $alias) : string | bool
Inherited

inherited_from \Zend\Di\InstanceManager::getBaseAlias()

Parameters

$alias

string

Exceptions

\Zend\Di\Exception\RuntimeException

Returns

stringbool

 Properties

 

Array of class aliases

$aliases : array
Inherited

inherited_from \Zend\Di\InstanceManager::$$aliases
 

The template to use for housing configuration information

$configurationTemplate : array
Inherited

inherited_from \Zend\Di\InstanceManager::$$configurationTemplate
 

An array of instance configuration data

$configurations : array
Inherited

inherited_from \Zend\Di\InstanceManager::$$configurations
 

$diInstanceManager

$diInstanceManager : \Zend\Di\InstanceManager

 

$serviceLocator

$serviceLocator : \Zend\ServiceManager\ServiceLocatorInterface

 

Array of shared instances

$sharedInstances : array
Inherited

inherited_from \Zend\Di\InstanceManager::$$sharedInstances
 

Array of shared instances with params

$sharedInstancesWithParams : array
Inherited

inherited_from \Zend\Di\InstanceManager::$$sharedInstancesWithParams
 

An array of globally preferred implementations for interfaces/abstracts

$typePreferences : array
Inherited

inherited_from \Zend\Di\InstanceManager::$$typePreferences