Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
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.