ExtendedContainer::get()publicWC 1.0

Get an instance of a registered class.

Метод класса: ExtendedContainer{}

Хуков нет.


Объект. An instance of the requested class.


$ExtendedContainer = new ExtendedContainer();
$ExtendedContainer->get( $id, $new );
$id(строка) (обязательный)
The class name.
True to generate a new instance even if the class was registered as shared.
По умолчанию: false

Код ExtendedContainer::get() WC 8.5.2

public function get( $id, bool $new = false ) {
	if ( false === strpos( $id, '\\' ) ) {
		throw new ContainerException( "Attempt to get an instance of the non-namespaced class '$id' from the container, did you forget to add a namespace import?" );

	return parent::get( $id, $new );