Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
DI\Definition\FactoryDefinition Class Reference
Inheritance diagram for DI\Definition\FactoryDefinition:
DI\Definition\Definition DI\Factory\RequestedEntry DI\Definition\DecoratorDefinition

Public Member Functions

 __construct (string $name, callable|array|string $factory, array $parameters=[])
 
 __toString ()
 Definitions can be cast to string for debugging information.
 
 getCallable ()
 
 getName ()
 Returns the name of the entry in the container.
 
 getParameters ()
 
 replaceNestedDefinitions (callable $replacer)
 Apply a callable that replaces the definitions nested in this definition.
 
 setName (string $name)
 Set the name of the entry in the container.
 

Constructor & Destructor Documentation

◆ __construct()

DI\Definition\FactoryDefinition::__construct ( string $name,
callable|array|string $factory,
array $parameters = [] )
Parameters
string$nameEntry name
callable | array | string$factoryCallable that returns the value associated to the entry name.
array$parametersParameters to be passed to the callable

Member Function Documentation

◆ __toString()

DI\Definition\FactoryDefinition::__toString ( )

Definitions can be cast to string for debugging information.

Implements DI\Definition\Definition.

Reimplemented in DI\Definition\DecoratorDefinition.

◆ getCallable()

DI\Definition\FactoryDefinition::getCallable ( )
Return values
callable|array|stringCallable that returns the value associated to the entry name.

◆ getName()

DI\Definition\FactoryDefinition::getName ( )

Returns the name of the entry in the container.

Implements DI\Definition\Definition.

◆ getParameters()

DI\Definition\FactoryDefinition::getParameters ( )
Return values
arrayArray containing the parameters to be passed to the callable, indexed by name.

◆ replaceNestedDefinitions()

DI\Definition\FactoryDefinition::replaceNestedDefinitions ( callable $replacer)

Apply a callable that replaces the definitions nested in this definition.

Implements DI\Definition\Definition.

Reimplemented in DI\Definition\DecoratorDefinition.

◆ setName()

DI\Definition\FactoryDefinition::setName ( string $name)

Set the name of the entry in the container.

Implements DI\Definition\Definition.


The documentation for this class was generated from the following file: