MediaWiki
REL1_20
|
Public Member Functions | |
__construct ($input=null, $flags=0, $iterator_class= 'ArrayIterator') | |
Constructor. | |
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 | |
integer | $indexOffset = 0 |
Definition at line 36 of file GenericArrayObject.php.
GenericArrayObject::__construct | ( | $ | input = null , |
$ | flags = 0 , |
||
$ | iterator_class = 'ArrayIterator' |
||
) |
Constructor.
null | array | $input | |
int | $flags | |
string | $iterator_class |
Definition at line 82 of file GenericArrayObject.php.
GenericArrayObject::append | ( | $ | value | ) |
mixed | $value |
Definition at line 99 of file GenericArrayObject.php.
Referenced by GenericArrayObjectTest\testAppend().
GenericArrayObject::getNewOffset | ( | ) | [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 62 of file GenericArrayObject.php.
GenericArrayObject::getObjectType | ( | ) | [abstract] |
Returns the name of an interface/class that the element should implement/extend.
GenericArrayObject::getSerializationData | ( | ) | [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 behaviour of this base class.
Definition at line 202 of file GenericArrayObject.php.
GenericArrayObject::hasValidType | ( | $ | value | ) | [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 125 of file GenericArrayObject.php.
Returns if the ArrayObject has no elements.
Definition at line 239 of file GenericArrayObject.php.
Referenced by GenericArrayObjectTest\testUnset().
GenericArrayObject::offsetSet | ( | $ | index, |
$ | value | ||
) |
mixed | $index | |
mixed | $value |
Definition at line 111 of file GenericArrayObject.php.
Referenced by GenericArrayObjectTest\testOffsetSet().
GenericArrayObject::preSetElement | ( | $ | index, |
$ | value | ||
) | [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.
integer | string | $index | |
mixed | $value |
Definition at line 178 of file GenericArrayObject.php.
Definition at line 189 of file GenericArrayObject.php.
GenericArrayObject::setElement | ( | $ | index, |
$ | value | ||
) | [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 146 of file GenericArrayObject.php.
GenericArrayObject::unserialize | ( | $ | serialization | ) |
string | $serialization |
Definition at line 218 of file GenericArrayObject.php.
integer GenericArrayObject::$indexOffset = 0 [protected] |