BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
ArrayObject Class Reference
Inheritance diagram for ArrayObject:
Collaboration diagram for ArrayObject:

Public Member Functions

 __construct ($input=null, $flags=0, $iterator_class="ArrayIterator")
 
 offsetExists ($index)
 
 offsetGet ($index)
 
 offsetSet ($index, $newval)
 
 offsetUnset ($index)
 
 append ($value)
 
 getArrayCopy ()
 
 count ()
 
 getFlags ()
 
 setFlags ($flags)
 
 asort ()
 
 ksort ()
 
 uasort ($cmp_function)
 
 uksort ($cmp_function)
 
 natsort ()
 
 natcasesort ()
 
 unserialize ($serialized)
 
 serialize ()
 
 getIterator ()
 
 exchangeArray ($input)
 
 setIteratorClass ($iterator_class)
 
 getIteratorClass ()
 

Public Attributes

const STD_PROP_LIST = 1
 
const ARRAY_AS_PROPS = 2
 

Detailed Description

This class allows objects to work as arrays. http://php.net/manual/en/class.arrayobject.php

Constructor & Destructor Documentation

Member Function Documentation

ArrayObject::append (   $value)

Appends the value mixed $value The value being appended.

Returns
void
Since
5.0.0
ArrayObject::asort ( )

Sort the entries by value void 5.2.0

ArrayObject::count ( )

Get the number of public properties in the ArrayObject When the ArrayObject is constructed from an array all properties are public. int The number of public properties in the ArrayObject. 5.0.0

Implements Countable.

ArrayObject::exchangeArray (   $input)

Exchange the array for another one. mixed $input The new array or object to exchange with the current array.

Returns
array the old array.
Since
5.1.0
ArrayObject::getFlags ( )
ArrayObject::getIterator ( )

Create a new iterator from an ArrayObject instance ArrayIterator An iterator from an ArrayObject. 5.0.0

Implements IteratorAggregate.

ArrayObject::getIteratorClass ( )
ArrayObject::ksort ( )

Sort the entries by key void 5.2.0

ArrayObject::natcasesort ( )

Sort an array using a case insensitive "natural order" algorithm void 5.2.0

ArrayObject::natsort ( )

Sort entries using a "natural order" algorithm void 5.2.0

ArrayObject::offsetExists (   $index)

Returns whether the requested index exists mixed $index The index being checked.

Returns
bool true if the requested index exists, otherwise false
Since
5.0.0

Implements ArrayAccess.

ArrayObject::offsetGet (   $index)

Returns the value at the specified index mixed $index The index with the value.

Returns
mixed The value at the specified index or false.
Since
5.0.0

Implements ArrayAccess.

ArrayObject::offsetSet (   $index,
  $newval 
)

Sets the value at the specified index to newval mixed $index The index being set.

Parameters
mixed$newval

The new value for the index.

Returns
void
Since
5.0.0

Implements ArrayAccess.

ArrayObject::offsetUnset (   $index)

Unsets the value at the specified index mixed $index The index being unset.

Returns
void
Since
5.0.0

Implements ArrayAccess.

ArrayObject::setFlags (   $flags)

Sets the behavior flags. int $flags The new ArrayObject behavior. It takes on either a bitmask, or named constants. Using named constants is strongly encouraged to ensure compatibility for future versions.

The available behavior flags are listed below. The actual meanings of these flags are described in the predefined constants.

behavior flags

value

constant

1

ArrayObject::STD_PROP_LIST

2

ArrayObject::ARRAY_AS_PROPS

Returns
void
Since
5.1.0
ArrayObject::setIteratorClass (   $iterator_class)

Sets the iterator classname for the ArrayObject. string $iterator_class The classname of the array iterator to use when iterating over this object.

Returns
void
Since
5.1.0
ArrayObject::uasort (   $cmp_function)

Sort the entries with a user-defined comparison function and maintain key association callback $cmp_function Function cmp_function should accept two parameters which will be filled by pairs of entries. The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

Returns
void
Since
5.2.0
ArrayObject::uksort (   $cmp_function)

Sort the entries by keys using a user-defined comparison function callback $cmp_function The callback comparison function.

Function cmp_function should accept two parameters which will be filled by pairs of entry keys. The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

Returns
void
Since
5.2.0
ArrayObject::unserialize (   $serialized)

Unserialize an ArrayObject string $serialized The serialized ArrayObject.

Returns
void The unserialized ArrayObject.
Since
5.3.0

Implements Serializable.

Member Data Documentation

const ArrayObject::ARRAY_AS_PROPS = 2

Entries can be accessed as properties (read and write).

const ArrayObject::STD_PROP_LIST = 1

Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.).


The documentation for this class was generated from the following file: