HordeArray
in package
implements
ArrayAccess, Countable, IteratorAggregate
Copyright 2007-2017 Horde LLC (http://www.horde.org/)
Tags
Interfaces, Classes, Traits and Enums
- ArrayAccess
- Countable
- IteratorAggregate
Table of Contents
- $_array : mixed
- Array variables
- __construct() : mixed
- __get() : mixed
- __isset() : bool
- Checks the existance of $key in this array
- __set() : void
- __unset() : void
- Removes $key from this array
- clear() : mixed
- Clear out the array
- count() : int
- Count the number of elements
- get() : mixed
- getIterator() : ArrayIterator
- getKeys() : array<string|int, mixed>
- Get the keys in the array
- getOrSet() : mixed
- Gets the value at $offset. If no value exists at that offset, or the value $offset is NULL, then $default is set as the value of $offset.
- getValues() : array<string|int, mixed>
- Get the values in the array
- offsetExists() : bool
- Checks the existence of $offset in this array
- offsetGet() : mixed
- Gets the value of $offset in this array
- offsetSet() : void
- Sets the value of $offset to $value
- offsetUnset() : void
- Removes $offset from this array
- pop() : mixed
- Gets the value at $offset and deletes it from the array. If no value exists at $offset, or the value at $offset is null, then $default will be returned.
- update() : mixed
- Update the array with the key/value pairs from $array
Properties
$_array
Array variables
protected
mixed
$_array
= []
Methods
__construct()
public
__construct([mixed $vars = [] ]) : mixed
Parameters
- $vars : mixed = []
Return values
mixed —__get()
public
__get(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —__isset()
Checks the existance of $key in this array
public
__isset(mixed $key) : bool
Parameters
- $key : mixed
Return values
bool —__set()
public
__set(mixed $key, mixed $value) : void
Parameters
- $key : mixed
- $value : mixed
Return values
void —__unset()
Removes $key from this array
public
__unset(mixed $key) : void
Parameters
- $key : mixed
Return values
void —clear()
Clear out the array
public
clear() : mixed
Return values
mixed —count()
Count the number of elements
public
count() : int
Return values
int —get()
public
get(mixed $key[, mixed $default = null ]) : mixed
Parameters
- $key : mixed
- $default : mixed = null
Return values
mixed —getIterator()
public
getIterator() : ArrayIterator
Return values
ArrayIterator —getKeys()
Get the keys in the array
public
getKeys() : array<string|int, mixed>
Return values
array<string|int, mixed> —getOrSet()
Gets the value at $offset. If no value exists at that offset, or the value $offset is NULL, then $default is set as the value of $offset.
public
getOrSet(string $offset[, string $default = null ]) : mixed
Parameters
- $offset : string
-
Offset to retrieve and set if unset
- $default : string = null
-
Default value if $offset does not exist
Return values
mixed —Value at $offset or $default
getValues()
Get the values in the array
public
getValues() : array<string|int, mixed>
Return values
array<string|int, mixed> —offsetExists()
Checks the existence of $offset in this array
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Tags
Return values
bool —offsetGet()
Gets the value of $offset in this array
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
Tags
Return values
mixed —offsetSet()
Sets the value of $offset to $value
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
Tags
Return values
void —offsetUnset()
Removes $offset from this array
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
Tags
Return values
void —pop()
Gets the value at $offset and deletes it from the array. If no value exists at $offset, or the value at $offset is null, then $default will be returned.
public
pop(string $offset[, string $default = null ]) : mixed
Parameters
- $offset : string
-
Offset to pop
- $default : string = null
-
Default value
Return values
mixed —Value at $offset or $default
update()
Update the array with the key/value pairs from $array
public
update(array<string|int, mixed>|Traversable $array) : mixed
Parameters
- $array : array<string|int, mixed>|Traversable
-
Key/value pairs to set/change in the array.