interface ChainsNestedItemsInterface

Contract for Managers that use magic methods to burrow into the item store See src/Traits/ChainsNestedItemsTrait.php for implementation example.

Methods

mixed
drop()

Deletes item at the current level of nesting (and below)

$this
__get(string $name)

Sets the current level of nesting.

mixed
__call(string $name, array $arguments)

Retrieves a value from the manager at the current nest level.

$this
__set(string $key, mixed $value)

Sets an item at the current nest level.

Details

at line line 15
mixed drop()

Deletes item at the current level of nesting (and below)

Return Value

mixed

at line line 30
$this __get(string $name)

Sets the current level of nesting.

When burrowing into a manager using magic methods, each level is a property $manager->one->two->etc. This method must set the current level. It does NOT return a value, only $this for method chaining.

See src/Traits/ChainsNestedItemsTrait.php for implementation example.

Parameters

string $name Next level in dot notation to set

Return Value

$this

at line line 46
mixed __call(string $name, array $arguments)

Retrieves a value from the manager at the current nest level.

Must return a value using $manager->get() using the called $name as the alias and the current level set by __get() as the prefix. Should throw ItemNotFoundException if item is not found.

See src/Traits/ChainsNestedItemsTrait.php for implementation example.

Parameters

string $name The alias to be retrieved
array $arguments Not used at present

Return Value

mixed item value

Exceptions

ItemNotFoundException

at line line 61
$this __set(string $key, mixed $value)

Sets an item at the current nest level.

Similar to __call() above. Must navigate to desired level through methods <$manager->one()->two()...> and then you can set a value as a property <$manger->one()->two = "two">

See src/Traits/ChainsNestedItemsTrait.php for implementation example.

Parameters

string $key The alias to be retrieved
mixed $value Value to be set

Return Value

$this

See also

Michaels\Manager\Contracts\ChainsNestedItemsInterface