Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core\di Class Reference

Static Public Member Functions

static get (string $id)
 Finds an entry of the container by its identifier and returns it.
 
static get_container ()
 Get the DI Container.
 
static reset_container ()
 Reset the DI Container.
 
static set (string $id, mixed $value)
 Set an entry in the container by its identifier.
 

Static Protected Member Functions

static create_container ()
 Create a new Container Instance.
 

Static Protected Attributes

static ContainerInterface ContainerInterface $container
 The stored container.
 

Member Function Documentation

◆ create_container()

static core\di::create_container ( )
staticprotected

Create a new Container Instance.

Return values
ContainerInterface

◆ get()

static core\di::get ( string $id)
static

Finds an entry of the container by its identifier and returns it.

This is a shortcut helper for core\di\get_container()->get($id).

Parameters
string$idIdentifier of the entry to look for.
Return values
mixedEntry.

◆ get_container()

static core\di::get_container ( )
static

Get the DI Container.

Return values
ContainerInterface

◆ reset_container()

static core\di::reset_container ( )
static

Reset the DI Container.

This is primarily intended for Unit Testing, and for use in Scheduled tasks.

◆ set()

static core\di::set ( string $id,
mixed $value )
static

Set an entry in the container by its identifier.

Parameters
string$idIdentifier of the entry to set
mixed$valueThe value to set

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