SPL-StandardPHPLibrary
Public Member Functions | Public Attributes | List of all members
ArrayObject Class Reference
Inheritance diagram for ArrayObject:
Inheritance graph
Collaboration diagram for ArrayObject:
Collaboration graph

Public Member Functions

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

Public Attributes

const ARRAY_AS_PROPS = 0x00000002
 
const STD_PROP_LIST = 0x00000001
 

Detailed Description

An Array wrapper.

Since
PHP 5.0
Version
1.2

This array wrapper allows to recursively iterate over Arrays and public Object properties.

See Also
ArrayIterator

Definition at line 620 of file spl.php.

Constructor & Destructor Documentation

ArrayObject::__construct (   $array,
  $flags = 0,
  $iterator_class = "ArrayIterator" 
)

Construct a new array iterator from anything that has a hash table.

That is any Array or Object.

Parameters
$arraythe array to use.
$flagssee setFlags().
$iterator_classclass used in getIterator()

Definition at line 635 of file spl.php.

635 {}

Member Function Documentation

ArrayObject::append (   $value)
Parameters
$valueis appended as last element
Warning
this method cannot be called when the ArrayObject refers to an object.

Definition at line 706 of file spl.php.

706 {}
ArrayObject::asort ( )

Sort the entries by values.

Definition at line 652 of file spl.php.

652 {}
ArrayObject::count ( )
Returns
the number of elements in the array or the number of public properties in the object.

Implements Countable.

Definition at line 717 of file spl.php.

717 {}
ArrayObject::exchangeArray (   $array)
Parameters
$arraynew array or object

Definition at line 676 of file spl.php.

676 {}
ArrayObject::getArrayCopy ( )
Returns
a copy of the array
Note
when the ArrayObject refers to an object then this method returns an array of the public properties.

Definition at line 712 of file spl.php.

712 {}
ArrayObject::getFlags ( )
Returns
current flags

Definition at line 648 of file spl.php.

648 {}
ArrayObject::getIterator ( )
Returns
the iterator which is an ArrayIterator object connected to this object.

Implements IteratorAggregate.

Definition at line 681 of file spl.php.

681 {}
ArrayObject::getIteratorClass ( )

Definition at line 725 of file spl.php.

725 {}
ArrayObject::ksort ( )

Sort the entries by key.

Definition at line 656 of file spl.php.

656 {}
ArrayObject::natcasesort ( )

Sort the entries by values using case insensitive "natural order" algorithm.

Definition at line 672 of file spl.php.

672 {}
ArrayObject::natsort ( )

Sort the entries by values using "natural order" algorithm.

Definition at line 668 of file spl.php.

668 {}
ArrayObject::offsetExists (   $index)
Parameters
$indexoffset to inspect
Returns
whetehr offset $index esists

Implements ArrayAccess.

Definition at line 686 of file spl.php.

686 {}
ArrayObject::offsetGet (   $index)
Parameters
$indexoffset to return value for
Returns
value at offset $index

Implements ArrayAccess.

Definition at line 691 of file spl.php.

691 {}
ArrayObject::offsetSet (   $index,
  $newval 
)
Parameters
$indexindex to set
$newvalnew value to store at offset $index

Implements ArrayAccess.

Definition at line 696 of file spl.php.

696 {}
ArrayObject::offsetUnset (   $index)
Parameters
$indexoffset to unset

Implements ArrayAccess.

Definition at line 700 of file spl.php.

700 {}
ArrayObject::setFlags (   $flags)

Set behavior flags.

Parameters
$flagsbitmask as follows: 0 set: properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.) 1 set: array indices can be accessed as properties in read/write

Definition at line 644 of file spl.php.

644 {}
ArrayObject::setIteratorClass (   $itertor_class)

Definition at line 721 of file spl.php.

721 {}
ArrayObject::uasort ( mixed  cmp_function)

Sort the entries by values using user defined function.

Definition at line 660 of file spl.php.

660 {}
ArrayObject::uksort ( mixed  cmp_function)

Sort the entries by key using user defined function.

Definition at line 664 of file spl.php.

664 {}

Member Data Documentation

const ArrayObject::ARRAY_AS_PROPS = 0x00000002

Array indices can be accessed as properties in read/write.

Definition at line 626 of file spl.php.

const ArrayObject::STD_PROP_LIST = 0x00000001

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

Definition at line 624 of file spl.php.


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