PHP_ArrayOf
[ class tree: PHP_ArrayOf ] [ index: PHP_ArrayOf ] [ all elements ]

Class: PHP_ArrayOf

Source Location: /PHP_ArrayOf-0.2.1/PHP/ArrayOf.php

Class Overview


Basic array class


Author(s):

Version:

  • Release: 0.2.1

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 64]
Basic array class


[ Top ]


Class Variables

$data = array()

[line 88]

To hold array data
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 98]

PHP_ArrayOf __construct( [array $array = null], [string $iteratorClass = 'ArrayIterator'])

Class constructor
  • Throws: PHP_ArrayOf_Exception
  • Access: public

Parameters:

array   $array   —  initialization array
string   $iteratorClass   —  Iterator class to use

[ Top ]

append   [line 115]

void append( mixed $value)

Appends an element to the array
  • Throws: PHP_ArrayOf_Exception
  • Access: public

Parameters:

mixed   $value   —  value to append

[ Top ]

convertOffsetValue   [line 286]

array convertOffsetValue( mixed $offset, mixed $value)

Converts an offset/value pair
  • Return: 2-element array [new offset to use, new value to use]
  • Throws: PHP_ArrayOf_Exception
  • Access: public

Parameters:

mixed   $offset   —  offset to convert
mixed   $value   —  value to convert

[ Top ]

count   [line 296]

integer count( )

Returns the count of elements
  • Access: public

[ Top ]

exchangeArray   [line 309]

void exchangeArray( array|PHP_ArrayOfInterface|ArrayObject $array)

Sets a whole new array replacement
  • Throws: PHP_ArrayOf_Exception
  • Access: public

Parameters:

array|PHP_ArrayOfInterface|ArrayObject   $array   —  New array

[ Top ]

getIterator   [line 149]

Iterator getIterator( )

Returns iterator for the object
  • Access: public

[ Top ]

getIteratorClass   [line 162]

string getIteratorClass( )

Returns iterator class name for the object
  • Access: public

[ Top ]

isValidElement   [line 259]

boolean isValidElement( mixed $value, [mixed $offset = null])

Checks whether a value is suitable for the array
  • Return: TRUE if valid, FALSE otherwise
  • Access: public

Parameters:

mixed   $value   —  value to check
mixed   $offset   —  offset the value would be stored at

[ Top ]

merge   [line 130]

void merge( array $array1, array $array2, array 2)

Merges arrays to the current object
  • Throws: PHP_ArrayOf_Exception
  • Access: public

Parameters:

array   $array1   —  First array to merge
array   $array2   —  Second array to merge
array   2   —  ... Etc

[ Top ]

offsetAvailable   [line 272]

boolean offsetAvailable( mixed $offset, mixed $value)

Checks if an element can be set at the offset
  • Return: TRUE if can be set, FALSE otherwise
  • Access: public

Parameters:

mixed   $offset   —  offset to use
mixed   $value   —  value that would be set

[ Top ]

offsetExists   [line 187]

boolean offsetExists( mixed $offset)

Returns whether the offset exists
  • Return: whether the offset exists
  • Access: public

Parameters:

mixed   $offset   —  to check

[ Top ]

offsetGet   [line 200]

mixed offsetGet( mixed $offset)

Returns the element for the offset
  • Return: value at given offset
  • Throws: PHP_ArrayOf_Exception
  • Access: public

Parameters:

mixed   $offset   —  to retrieve

[ Top ]

offsetSet   [line 219]

void offsetSet( mixed $offset, mixed $value)

Sets the element for the offset
  • Throws: PHP_ArrayOf_Exception
  • Access: public

Parameters:

mixed   $offset   —  to modify
mixed   $value   —  new value

[ Top ]

offsetUnset   [line 245]

void offsetUnset( mixed $offset)

Deletes the element for the offset
  • Access: public

Parameters:

mixed   $offset   —  to delete

[ Top ]

setIteratorClass   [line 174]

void setIteratorClass( string $iteratorClass)

Sets the iterator class name for the object
  • Access: public

Parameters:

string   $iteratorClass   —  new class name

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:21:22 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.