MediaWiki REL1_33
|
Public Member Functions | |
__construct ( $input=null, $flags=0, $iterator_class='ArrayIterator') | |
append ( $value) | |
getObjectType () | |
Returns the name of an interface/class that the element should implement/extend. | |
isEmpty () | |
Returns if the ArrayObject has no elements. | |
offsetSet ( $index, $value) | |
serialize () | |
unserialize ( $serialization) | |
Protected Member Functions | |
getNewOffset () | |
Finds a new offset for when appending an element. | |
getSerializationData () | |
Returns an array holding all the data that should go into serialization calls. | |
hasValidType ( $value) | |
Returns if the provided value has the same type as the elements that can be added to this ArrayObject. | |
preSetElement ( $index, $value) | |
Gets called before a new element is added to the ArrayObject. | |
setElement ( $index, $value) | |
Method that actually sets the element and holds all common code needed for set operations, including type checking and offset resolving. | |
Protected Attributes | |
int | $indexOffset = 0 |
Definition at line 35 of file GenericArrayObject.php.
GenericArrayObject::__construct | ( | $input = null , |
|
$flags = 0 , |
|||
$iterator_class = 'ArrayIterator' |
|||
) |
null | array | $input | |
int | $flags | |
string | $iterator_class |
Definition at line 78 of file GenericArrayObject.php.
References $input, $value, as, and offsetSet().
GenericArrayObject::append | ( | $value | ) |
mixed | $value |
Definition at line 95 of file GenericArrayObject.php.
References $value, and setElement().
Referenced by GenericArrayObjectTest\testAppend().
|
protected |
Finds a new offset for when appending an element.
The base class does this, so it would be better to integrate, but there does not appear to be any way to do this...
Definition at line 61 of file GenericArrayObject.php.
References $indexOffset.
Referenced by setElement().
|
abstract |
Returns the name of an interface/class that the element should implement/extend.
Reimplemented in SiteList.
Referenced by hasValidType(), and setElement().
|
protected |
Returns an array holding all the data that should go into serialization calls.
This is intended to allow overloading without having to reimplement the behavior of this base class.
Reimplemented in SiteList.
Definition at line 199 of file GenericArrayObject.php.
References $indexOffset.
Referenced by serialize().
|
protected |
Returns if the provided value has the same type as the elements that can be added to this ArrayObject.
mixed | $value |
Definition at line 121 of file GenericArrayObject.php.
References $value, and getObjectType().
Referenced by setElement().
GenericArrayObject::isEmpty | ( | ) |
Returns if the ArrayObject has no elements.
Reimplemented in SiteList.
Definition at line 236 of file GenericArrayObject.php.
Referenced by GenericArrayObjectTest\testUnset().
GenericArrayObject::offsetSet | ( | $index, | |
$value | |||
) |
mixed | $index | |
mixed | $value |
Definition at line 107 of file GenericArrayObject.php.
References $value, and setElement().
Referenced by __construct(), and GenericArrayObjectTest\testOffsetSet().
|
protected |
Gets called before a new element is added to the ArrayObject.
At this point the index is always set (ie not null) and the value is always of the type returned by
Should return a boolean. When false is returned the element does not get added to the ArrayObject.
int | string | $index | |
mixed | $value |
Reimplemented in SiteList.
Definition at line 175 of file GenericArrayObject.php.
Referenced by setElement().
GenericArrayObject::serialize | ( | ) |
Definition at line 186 of file GenericArrayObject.php.
References getSerializationData(), and serialize().
Referenced by serialize().
|
protected |
Method that actually sets the element and holds all common code needed for set operations, including type checking and offset resolving.
If you want to do additional indexing or have code that otherwise needs to be executed whenever an element is added, you can overload
mixed | $index | |
mixed | $value |
InvalidArgumentException |
Definition at line 142 of file GenericArrayObject.php.
References $value, getNewOffset(), getObjectType(), hasValidType(), and preSetElement().
Referenced by append(), and offsetSet().
GenericArrayObject::unserialize | ( | $serialization | ) |
string | $serialization |
Reimplemented in SiteList.
Definition at line 215 of file GenericArrayObject.php.
References $value, as, and unserialize().
Referenced by unserialize().
|
protected |
Definition at line 50 of file GenericArrayObject.php.
Referenced by getNewOffset(), and getSerializationData().