ArrayObject Class Reference
[Internal classes]

An Array wrapper. More...

Inheritance diagram for ArrayObject:

Inheritance graph
{IteratorAggregate\n||+ getIterator()\l}{Traversable\n||}{ArrayAccess\n||+ offsetExists()\l+ offsetGet()\l+ offsetSet()\l+ offsetUnset()\l}{Countable\n||+ count()\l}
[legend]
Collaboration diagram for ArrayObject:

Collaboration graph
{IteratorAggregate\n||+ getIterator()\l}{Traversable\n||}{ArrayAccess\n||+ offsetExists()\l+ offsetGet()\l+ offsetSet()\l+ offsetUnset()\l}{Countable\n||+ count()\l}
[legend]
List of all members.

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 606 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:
$array the array to use.
$flags see setFlags().
$iterator_class class used in getIterator()

Definition at line 621 of file spl.php.

00621 {}


Member Function Documentation

ArrayObject::append ( value  ) 

Parameters:
$value is appended as last element

Warning:
this method cannot be called when the ArrayObject refers to an object.

Definition at line 692 of file spl.php.

00692 {}

ArrayObject::asort (  ) 

Sort the entries by values.

Definition at line 638 of file spl.php.

00638 {}

ArrayObject::count (  ) 

Returns:
the number of elements in the array or the number of public properties in the object.

Implements Countable.

Definition at line 703 of file spl.php.

00703 {}

ArrayObject::exchangeArray ( array  ) 

Parameters:
$array new array or object

Definition at line 662 of file spl.php.

00662 {}

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 698 of file spl.php.

00698 {}

ArrayObject::getFlags (  ) 

Returns:
current flags

Definition at line 634 of file spl.php.

00634 {}

ArrayObject::getIterator (  ) 

Returns:
the iterator which is an ArrayIterator object connected to this object.

Implements IteratorAggregate.

Definition at line 667 of file spl.php.

00667 {}

ArrayObject::getIteratorClass (  ) 

Definition at line 711 of file spl.php.

00711 {}

ArrayObject::ksort (  ) 

Sort the entries by key.

Definition at line 642 of file spl.php.

00642 {}

ArrayObject::natcasesort (  ) 

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

Definition at line 658 of file spl.php.

00658 {}

ArrayObject::natsort (  ) 

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

Definition at line 654 of file spl.php.

00654 {}

ArrayObject::offsetExists ( index  ) 

Parameters:
$index offset to inspect

Returns:
whetehr offset $index esists

Implements ArrayAccess.

Definition at line 672 of file spl.php.

00672 {}

ArrayObject::offsetGet ( index  ) 

Parameters:
$index offset to return value for

Returns:
value at offset $index

Implements ArrayAccess.

Definition at line 677 of file spl.php.

00677 {}

ArrayObject::offsetSet ( index,
newval 
)

Parameters:
$index index to set

Parameters:
$newval new value to store at offset $index

Implements ArrayAccess.

Definition at line 682 of file spl.php.

00682 {}

ArrayObject::offsetUnset ( index  ) 

Parameters:
$index offset to unset

Implements ArrayAccess.

Definition at line 686 of file spl.php.

00686 {}

ArrayObject::setFlags ( flags  ) 

Set behavior flags.

Parameters:
$flags bitmask 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 630 of file spl.php.

00630 {}

ArrayObject::setIteratorClass ( itertor_class  ) 

Definition at line 707 of file spl.php.

00707 {}

ArrayObject::uasort ( mixed  cmp_function  ) 

Sort the entries by values using user defined function.

Definition at line 646 of file spl.php.

00646 {}

ArrayObject::uksort ( mixed  cmp_function  ) 

Sort the entries by key using user defined function.

Definition at line 650 of file spl.php.

00650 {}


Member Data Documentation

const ArrayObject::ARRAY_AS_PROPS = 0x00000002

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

Definition at line 612 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 610 of file spl.php.


The documentation for this class was generated from the following file:
Generated on Thu Apr 26 01:05:02 2007 for SPL-StandardPHPLibrary by  doxygen 1.5.2