ArrayObject
in package
implements
IteratorAggregate, ArrayAccess, Countable
***** PHP 7.3 modified variant of ZF2 Array Object *****
Custom framework ArrayObject implementation
Extends version-specific "abstract" implementation.
Table of Contents
Interfaces
- IteratorAggregate
- ArrayAccess
- Countable
Constants
- ARRAY_AS_PROPS = 2
- Entries can be accessed as properties (read and write).
- STD_PROP_LIST = 1
- Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.).
Properties
- $flag : int
- $iteratorClass : string
- $protectedProperties : array<string|int, mixed>
- $storage : array<string|int, mixed>
Methods
- __construct() : mixed
- Constructor
- __get() : mixed
- Returns the value at the specified key by reference
- __isset() : bool
- Returns whether the requested key exists
- __serialize() : array<string|int, mixed>
- Serialize an ArrayObject
- __set() : void
- Sets the value at the specified key to value
- __unserialize() : void
- Unserialize an ArrayObject
- __unset() : void
- Unsets the value at the specified key
- append() : void
- Appends the value
- asort() : void
- Sort the entries by value
- count() : int
- Get the number of public properties in the ArrayObject
- exchangeArray() : array<string|int, mixed>
- Exchange the array for another one.
- getArrayCopy() : array<string|int, mixed>
- Creates a copy of the ArrayObject.
- getFlags() : int
- Gets the behavior flags.
- getIterator() : Iterator
- Create a new iterator from an ArrayObject instance
- getIteratorClass() : string
- Gets the iterator classname for the ArrayObject.
- ksort() : void
- Sort the entries by key
- natcasesort() : void
- Sort an array using a case insensitive "natural order" algorithm
- natsort() : void
- Sort entries using a "natural order" algorithm
- offsetExists() : bool
- Returns whether the requested key exists
- offsetGet() : mixed
- Returns the value at the specified key
- offsetSet() : void
- Sets the value at the specified key to value
- offsetUnset() : void
- Unsets the value at the specified key
- setFlags() : void
- Sets the behavior flags
- setIteratorClass() : void
- Sets the iterator classname for the ArrayObject
- uasort() : void
- Sort the entries with a user-defined comparison function and maintain key association
- uksort() : void
- Sort the entries by keys using a user-defined comparison function
Constants
ARRAY_AS_PROPS
Entries can be accessed as properties (read and write).
public
mixed
ARRAY_AS_PROPS
= 2
STD_PROP_LIST
Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.).
public
mixed
STD_PROP_LIST
= 1
Properties
$flag
protected
int
$flag
$iteratorClass
protected
string
$iteratorClass
$protectedProperties
protected
array<string|int, mixed>
$protectedProperties
$storage
protected
array<string|int, mixed>
$storage
Methods
__construct()
Constructor
public
__construct([array<string|int, mixed> $input = [] ][, int $flags = self::STD_PROP_LIST ][, string $iteratorClass = 'ArrayIterator' ]) : mixed
Parameters
- $input : array<string|int, mixed> = []
- $flags : int = self::STD_PROP_LIST
- $iteratorClass : string = 'ArrayIterator'
__get()
Returns the value at the specified key by reference
public
& __get(mixed $key) : mixed
Parameters
- $key : mixed
__isset()
Returns whether the requested key exists
public
__isset(mixed $key) : bool
Parameters
- $key : mixed
Return values
bool__serialize()
Serialize an ArrayObject
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__set()
Sets the value at the specified key to value
public
__set(mixed $key, mixed $value) : void
Parameters
- $key : mixed
- $value : mixed
__unserialize()
Unserialize an ArrayObject
public
__unserialize(array<string|int, mixed> $ar) : void
Parameters
- $ar : array<string|int, mixed>
__unset()
Unsets the value at the specified key
public
__unset(mixed $key) : void
Parameters
- $key : mixed
append()
Appends the value
public
append(mixed $value) : void
Parameters
- $value : mixed
asort()
Sort the entries by value
public
asort() : void
count()
Get the number of public properties in the ArrayObject
public
count() : int
Return values
intexchangeArray()
Exchange the array for another one.
public
exchangeArray(array<string|int, mixed>|ArrayObject $data) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>|ArrayObject
Return values
array<string|int, mixed>getArrayCopy()
Creates a copy of the ArrayObject.
public
getArrayCopy() : array<string|int, mixed>
Return values
array<string|int, mixed>getFlags()
Gets the behavior flags.
public
getFlags() : int
Return values
intgetIterator()
Create a new iterator from an ArrayObject instance
public
getIterator() : Iterator
Return values
IteratorgetIteratorClass()
Gets the iterator classname for the ArrayObject.
public
getIteratorClass() : string
Return values
stringksort()
Sort the entries by key
public
ksort() : void
natcasesort()
Sort an array using a case insensitive "natural order" algorithm
public
natcasesort() : void
natsort()
Sort entries using a "natural order" algorithm
public
natsort() : void
offsetExists()
Returns whether the requested key exists
public
offsetExists(mixed $key) : bool
Parameters
- $key : mixed
Return values
booloffsetGet()
Returns the value at the specified key
public
& offsetGet(mixed $key) : mixed
Parameters
- $key : mixed
offsetSet()
Sets the value at the specified key to value
public
offsetSet(mixed $key, mixed $value) : void
Parameters
- $key : mixed
- $value : mixed
offsetUnset()
Unsets the value at the specified key
public
offsetUnset(mixed $key) : void
Parameters
- $key : mixed
setFlags()
Sets the behavior flags
public
setFlags(int $flags) : void
Parameters
- $flags : int
setIteratorClass()
Sets the iterator classname for the ArrayObject
public
setIteratorClass(string $class) : void
Parameters
- $class : string
uasort()
Sort the entries with a user-defined comparison function and maintain key association
public
uasort(callable $function) : void
Parameters
- $function : callable
uksort()
Sort the entries by keys using a user-defined comparison function
public
uksort(callable $function) : void
Parameters
- $function : callable