Zend\Di\ServiceLocator\GeneratorInstance
Container for methods and parameters used by by Di to create a particular instance
Synopsis
class GeneratorInstance
{
- // members
- protected string|null $class;
- protected string|null $alias;
- protected mixed $constructor;
- protected array $params;
- protected array $methods;
- protected bool $shared;
- // methods
- public void __construct()
- public string|null getName()
- public string|null getClass()
- public string|null getAlias()
- public GeneratorInstance setClass()
- public GeneratorInstance setAlias()
- public mixed getConstructor()
- public array getParams()
- public GeneratorInstance setMethods()
- public GeneratorInstance addMethod()
- public array getMethods()
- public void setShared()
- public bool isShared()
Members
protected
- $alias — Zend\Di\ServiceLocator\string|null
- $class — Zend\Di\ServiceLocator\string|null
- $constructor — mixed
- $methods — array
- $params — array
Methods
public
- __construct()
- addMethod() — Add a method called on the instance
- getAlias() — Alias for the instance (if any)
- getClass() — Class of the instance. Null if class is unclear (such as when the instance is produced by a callback)
- getConstructor() — Get instantiator
- 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
- getName() — Retrieves the best available name for this instance (instance alias first then class name)
- 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
- setAlias() — Set instance alias
- setClass() — Set class name
- setMethods() — Set methods