Anemone::get()

Gets value recursively.

Table of Contents
  1. Description
  2. Example

Description

Anemone::get(?string $key = null): mixed;

Gets value recursively using dot notation syntax. This is the OOP style of function get(), implemented as a class method. If the value does not exist, this method returns null.

Example

$anemone = new Anemone([
    'foo' => 1,
    'bar' => [
        'baz' => 2,
        'qux' => 3
    ]
]);

$foo = $anemone->get('foo'); // Returns `1`
$baz = $anemone->get('bar.baz'); // Returns `2`
$wut = $anemone->get('bar.wut'); // Returns `null`

$all = $anemone->get(); // Returns `['foo' => 1, 'bar' => ['baz' => 2, 'qux' => 3]]`

Anemone::any()

Checks if at least one item in the data passes the test.

Anemone::get()

Gets value recursively.

Anemone::is()

Filters the data so that only items that pass the test are left.

Anemone::not()

Filters the data so that only items that do not pass the test are left.

Anemone::pluck()

Returns a new data set contains values from the key on every item.