Class Zend\Stdlib\ArrayObject
Inheritance | Zend\Stdlib\ArrayObject |
---|---|
Implements | ArrayAccess, Countable, IteratorAggregate, Serializable |
PHP 7.3 modified variant of ZF2 Array Object
Custom framework ArrayObject implementation
Extends version-specific "abstract" implementation.
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$flag | integer | Zend\Stdlib\ArrayObject | |
$iteratorClass | string | Zend\Stdlib\ArrayObject | |
$protectedProperties | array | Zend\Stdlib\ArrayObject | |
$storage | array | Zend\Stdlib\ArrayObject |
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Constructor | Zend\Stdlib\ArrayObject |
__get() | Returns the value at the specified key by reference | Zend\Stdlib\ArrayObject |
__isset() | Returns whether the requested key exists | Zend\Stdlib\ArrayObject |
__set() | Sets the value at the specified key to value | Zend\Stdlib\ArrayObject |
__unset() | Unsets the value at the specified key | Zend\Stdlib\ArrayObject |
append() | Appends the value | Zend\Stdlib\ArrayObject |
asort() | Sort the entries by value | Zend\Stdlib\ArrayObject |
count() | Get the number of public properties in the ArrayObject | Zend\Stdlib\ArrayObject |
exchangeArray() | Exchange the array for another one. | Zend\Stdlib\ArrayObject |
getArrayCopy() | Creates a copy of the ArrayObject. | Zend\Stdlib\ArrayObject |
getFlags() | Gets the behavior flags. | Zend\Stdlib\ArrayObject |
getIterator() | Create a new iterator from an ArrayObject instance | Zend\Stdlib\ArrayObject |
getIteratorClass() | Gets the iterator classname for the ArrayObject. | Zend\Stdlib\ArrayObject |
ksort() | Sort the entries by key | Zend\Stdlib\ArrayObject |
natcasesort() | Sort an array using a case insensitive "natural order" algorithm | Zend\Stdlib\ArrayObject |
natsort() | Sort entries using a "natural order" algorithm | Zend\Stdlib\ArrayObject |
offsetExists() | Returns whether the requested key exists | Zend\Stdlib\ArrayObject |
offsetGet() | Returns the value at the specified key | Zend\Stdlib\ArrayObject |
offsetSet() | Sets the value at the specified key to value | Zend\Stdlib\ArrayObject |
offsetUnset() | Unsets the value at the specified key | Zend\Stdlib\ArrayObject |
serialize() | Serialize an ArrayObject | Zend\Stdlib\ArrayObject |
setFlags() | Sets the behavior flags | Zend\Stdlib\ArrayObject |
setIteratorClass() | Sets the iterator classname for the ArrayObject | Zend\Stdlib\ArrayObject |
uasort() | Sort the entries with a user-defined comparison function and maintain key association | Zend\Stdlib\ArrayObject |
uksort() | Sort the entries by keys using a user-defined comparison function | Zend\Stdlib\ArrayObject |
unserialize() | Unserialize an ArrayObject | Zend\Stdlib\ArrayObject |
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
ARRAY_AS_PROPS | 2 | Entries can be accessed as properties (read and write). | Zend\Stdlib\ArrayObject |
STD_PROP_LIST | 1 | Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.). | Zend\Stdlib\ArrayObject |
Property Details
Method Details
Constructor
public void __construct ( $input = [], $flags = self::STD_PROP_LIST, $iteratorClass = 'ArrayIterator' ) | ||
$input | array | |
$flags | integer | |
$iteratorClass | string |
Returns the value at the specified key by reference
public &mixed __get ( $key ) | ||
$key | mixed |
Returns whether the requested key exists
public boolean __isset ( $key ) | ||
$key | mixed |
Sets the value at the specified key to value
public void __set ( $key, $value ) | ||
$key | mixed | |
$value | mixed |
Unsets the value at the specified key
public void __unset ( $key ) | ||
$key | mixed |
Appends the value
public void append ( $value ) | ||
$value | mixed |
Sort the entries by value
public void asort ( ) |
Get the number of public properties in the ArrayObject
public integer count ( ) |
Exchange the array for another one.
public array exchangeArray ( $data ) | ||
$data | array|Zend\Stdlib\ArrayObject |
Creates a copy of the ArrayObject.
public array getArrayCopy ( ) |
Gets the behavior flags.
public integer getFlags ( ) |
Create a new iterator from an ArrayObject instance
public Iterator getIterator ( ) |
Gets the iterator classname for the ArrayObject.
public string getIteratorClass ( ) |
Sort the entries by key
public void ksort ( ) |
Sort an array using a case insensitive "natural order" algorithm
public void natcasesort ( ) |
Sort entries using a "natural order" algorithm
public void natsort ( ) |
Returns whether the requested key exists
public boolean offsetExists ( $key ) | ||
$key | mixed |
Returns the value at the specified key
public &mixed offsetGet ( $key ) | ||
$key | mixed |
Sets the value at the specified key to value
public void offsetSet ( $key, $value ) | ||
$key | mixed | |
$value | mixed |
Unsets the value at the specified key
public void offsetUnset ( $key ) | ||
$key | mixed |
Serialize an ArrayObject
public string serialize ( ) |
Sets the behavior flags
public void setFlags ( $flags ) | ||
$flags | integer |
Sets the iterator classname for the ArrayObject
public void setIteratorClass ( $class ) | ||
$class | string |
Sort the entries with a user-defined comparison function and maintain key association
public void uasort ( $function ) | ||
$function | callable |
Sort the entries by keys using a user-defined comparison function
public void uksort ( $function ) | ||
$function | callable |
Unserialize an ArrayObject
public void unserialize ( $data ) | ||
$data | string |