AbstractServiceProvider::add()protectedWC 1.0

Register an entry in the container.

Method of the class: AbstractServiceProvider{}

No Hooks.


DefinitionInterface. The generated container definition.


// protected - for code of main (parent) or child class
$result = $this->add( $id, $concrete, $shared ) : DefinitionInterface;
$id(string) (required)
Entry id (typically a class or interface name).
Concrete entity to register under that id, null for automatic creation.
Default: null
Whether to register the class as shared (get always returns the same instance) or not.
Default: null

AbstractServiceProvider::add() code WC 8.7.0

protected function add( string $id, $concrete = null, bool $shared = null ) : DefinitionInterface {
	return $this->getContainer()->add( $id, $concrete, $shared );