1695. Class

1695.1. Zend\Di\ServiceLocator\GeneratorInstance

Container for methods and parameters used by by Di to create a particular instance

1695.1.1. Methods

1695.1.1.1. __construct

__construct()

@param string|null $class

Parameters:
  • string|null
  • mixed
  • array

1695.1.1.2. getName

getName()

Retrieves the best available name for this instance (instance alias first then class name)

Return type:string|null

1695.1.1.3. getClass

getClass()

Class of the instance. Null if class is unclear (such as when the instance is produced by a callback)

Return type:string|null

1695.1.1.4. getAlias

getAlias()

Alias for the instance (if any)

Return type:string|null

1695.1.1.5. setClass

setClass()

Set class name

In the case of an instance created via a callback, we need to set the class name after creating the generator instance.

Parameters:string
Return type:GeneratorInstance

1695.1.1.6. setAlias

setAlias()

Set instance alias

Parameters:string
Return type:GeneratorInstance

1695.1.1.7. getConstructor

getConstructor()

Get instantiator

Return type:mixed constructor method name or callable responsible for generating instance

1695.1.1.8. getParams

getParams()

Parameters passed to the instantiator as an ordered list of parameters. Each parameter that refers to another instance fetched recursively is a GeneratorInstance itself

Return type:array

1695.1.1.9. setMethods

setMethods()

Set methods

Parameters:array
Return type:GeneratorInstance

1695.1.1.10. addMethod

addMethod()

Add a method called on the instance

Parameters:$method
Return type:GeneratorInstance

1695.1.1.11. getMethods

getMethods()

Retrieves a list of methods that are called on the instance in their call order. Each returned element has form array(‘method’ => ‘methodName’, ‘params’ => array( ... ordered list of call parameters ... ), where every call parameter that is a recursively fetched instance is a GeneratorInstance itself

Return type:array

1695.1.1.12. setShared

setShared()

@param bool $shared

1695.1.1.13. isShared

isShared()

Retrieves whether the instance is shared or not

Return type:bool