Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
|
Public Member Functions | |
make (string $name, array $parameters=[]) | |
Resolves an entry by its name. | |
DI\FactoryInterface::make | ( | string | $name, |
array | $parameters = [] ) |
Resolves an entry by its name.
If given a class name, it will return a new instance of that class.
string | $name | Entry name or a class name. |
array | $parameters | Optional parameters to use to build the entry. Use this to force specific parameters to specific values. Parameters not defined in this array will be automatically resolved. |
InvalidArgumentException | The name parameter must be of type string. |
DependencyException | Error while resolving the entry. |
NotFoundException | No entry or class found for the given name. |
Implemented in DI\Container.