Automattic\WooCommerce\Vendor\League\Container\Definition
DefinitionAggregate::add() public WC 1.0
{@inheritdoc}
{} It's a method of the class: DefinitionAggregate{}
No Hooks.
Return
Null. Nothing.
Usage
$DefinitionAggregate = new DefinitionAggregate(); $DefinitionAggregate->add( $id, $definition, $shared ) : DefinitionInterface;
- $id(string) (required)
- -
- $definition (required)
- -
- $shared(true/false)
- -
Default: false
Code of DefinitionAggregate::add() DefinitionAggregate::add WC 5.0.0
public function add(string $id, $definition, bool $shared = false) : DefinitionInterface
{
if (!$definition instanceof DefinitionInterface) {
$definition = new Definition($id, $definition);
}
$this->definitions[] = $definition
->setAlias($id)
->setShared($shared)
;
return $definition;
}