-
getData() : void
-
Arr constructor.
-
Whether or not a data exists by key.
-
Retrieve a single key from an array.
-
Assigns a value to the specified data.
-
Add data to set, replaces the existing data.
-
Alias of the `merge` method.
-
all() : arrayFetch all data.
-
Fetch some data.
-
Gets value from data applying filters if needed.
-
Set data, clears and overwrites the current data.
-
keys() : arrayFetch set data keys.
-
Remove a data by key.
-
clear() : voidClear all values.
-
count() : intCount all elements in a data.
-
Get a data iterator.
-
Gets a value from an array using a dot separated path.
-
toArray() : arrayConverts recursively the object to an array.
-
Whether or not an offset exists.
-
Returns the value at specified offset.
-
Assigns a value to the specified offset.
-
Unsets an offset.
-
Magic isset, whether or not a key exists.
-
Magic get, returns the value at specified key.
-
Magic set, assigns a value to the specified key.
-
Magic unset, unsets a key.
-
zephir_init_properties_Ice_Arr() : void
-
public function getData()
-
public function __construct(array $data)
Arr constructor. -
public function has(string $key)
Whether or not a data exists by key. -
public function get(string $key, variable $defaultValue)
Retrieve a single key from an array.If the key does not exist in the array, the default value will be returned. -
public function set(string $key, variable $value)
Assigns a value to the specified data. -
public function merge(array $data)
Add data to set, replaces the existing data. -
public function replace(array $data)
Alias of the `merge` method. -
public function all()
Fetch all data. -
public function only(array $keys, bool $strict)
Fetch some data. -
public function getValue(string $key, variable $filters, variable $defaultValue, bool $allowEmpty)
Gets value from data applying filters if needed.//Returns value from $arr["id"] without sanitizing $id = $arr->getValue("id"); //Returns value from $arr["title"] with sanitizing $title = $arr->getValue("title", "escape|repeats"); //Returns value from $arr["id"] with a default value $id = $arr->getValue("id", null, 150);
-
public function setData(array $data)
Set data, clears and overwrites the current data. -
public function keys()
Fetch set data keys. -
public function remove(string $key)
Remove a data by key. -
public function clear()
Clear all values. -
public function count()
Count all elements in a data. -
public function getIterator()
Get a data iterator.return ArrayIterator -
public function getPath(variable $path, variable $defaultValue, string $delimiter)
Gets a value from an array using a dot separated path.// Get the value of $array['foo']['bar'] $value = (new Arr($array))->getPath('foo.bar');
// Get the values of "color" in theme $colors = (new Arr($array))->getPath('theme..color');
-
public function toArray()
Converts recursively the object to an array. -
public function offsetExists(mixed $offset)
Whether or not an offset exists. -
public function offsetGet(mixed $offset)
Returns the value at specified offset. -
public function offsetSet(mixed $offset, variable $value)
Assigns a value to the specified offset. -
public function offsetUnset(mixed $offset)
Unsets an offset. -
public function __isset(string $key)
Magic isset, whether or not a key exists. -
public function __get(variable $key)
Magic get, returns the value at specified key.First check if property exist. -
public function __set(string $key, variable $value)
Magic set, assigns a value to the specified key.First check if property exist. -
public function __unset(variable $key)
Magic unset, unsets a key. -
internal function zephir_init_properties_Ice_Arr()