Automattic\WooCommerce\Vendor\League\Container
Container::add()
Add an item to the container.
Метод класса: Container{}
Хуков нет.
Возвращает
DefinitionInterface
.
Использование
$Container = new Container(); $Container->add( $id, $concrete, $shared ) : DefinitionInterface;
- $id(строка) (обязательный)
- -
- $concrete(разное)
- -
По умолчанию: null - $shared(true|false)
- -
По умолчанию: null
Код Container::add() Container::add WC 7.5.1
public function add(string $id, $concrete = null, bool $shared = null) : DefinitionInterface { $concrete = $concrete ?? $id; $shared = $shared ?? $this->defaultToShared; return $this->definitions->add($id, $concrete, $shared); }