ice framework documentation ice doc v1.10.1
Methods
  • getData() : void
  • __construct(array $data) : void
    Arr constructor.
  • has(string $key) : bool
    Whether or not a data exists by key.
  • get(string $key, variable $defaultValue) : void
    Retrieve a single key from an array.
  • set(string $key, variable $value) : void
    Assigns a value to the specified data.
  • merge(array $data) : void
    Add data to set, replaces the existing data.
  • replace(array $data) : void
    Alias of the `merge` method.
  • all() : array
    Fetch all data.
  • only(array $keys, bool $strict) : array
    Fetch some data.
  • getValue(string $key, variable $filters, variable $defaultValue, bool $allowEmpty) : void
    Gets value from data applying filters if needed.
  • setData(array $data) : void
    Set data, clears and overwrites the current data.
  • keys() : array
    Fetch set data keys.
  • remove(string $key) : void
    Remove a data by key.
  • clear() : void
    Clear all values.
  • count() : int
    Count all elements in a data.
  • Get a data iterator.
  • getPath(variable $path, variable $defaultValue, string $delimiter) : void
    Gets a value from an array using a dot separated path.
  • toArray() : array
    Converts recursively the object to an array.
  • offsetExists(mixed $offset) : bool
    Whether or not an offset exists.
  • offsetGet(mixed $offset) : mixed
    Returns the value at specified offset.
  • offsetSet(mixed $offset, variable $value) : void
    Assigns a value to the specified offset.
  • offsetUnset(mixed $offset) : void
    Unsets an offset.
  • __isset(string $key) : bool
    Magic isset, whether or not a key exists.
  • __get(variable $key) : void
    Magic get, returns the value at specified key.
  • __set(string $key, variable $value) : void
    Magic set, assigns a value to the specified key.
  • __unset(variable $key) : void
    Magic unset, unsets a key.
Methods Details
  • 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()