JArrayHelper
Description
JArrayHelper is an array utility class for doing all sorts of odds and ends with arrays.
Located in /joomla/utilities/arrayhelper.php (line 23)
JArrayHelper (Subpackage Utilities)
Method Summary
Methods
Utility function to map an object to an array
array
fromObject
(object The $p_obj, [boolean $recurse = true], [string $regex = null])
- object The $p_obj: source object
- boolean $recurse: True to recurve through multi-level objects
- string $regex: An optional regular expression to match on field names
Extracts a column from an array of arrays or objects
array
getColumn
( &$array, string $index, array $array)
- array $array: The source array
- string $index: The index of the column or name of object property
- &$array
Utility function to return a value from a named array or a specified default
mixed
getValue
( &$array, string $name, [mixed $default = null], [string $type = ''], array $array)
- array $array: A named array
- string $name: The key to search for
- mixed $default: The default value to give if no key found
- string $type: Return type for the variable (INT, FLOAT, STRING, WORD, BOOLEAN, ARRAY)
- &$array
Utility function to sort an array of objects on a given field
array
sortObjects
( &$a, string $k, [int $direction = 1], array $arr)
- array $arr: An array of objects
- string $k: The key to sort on
- int $direction: Direction to sort in [1 = Ascending] [-1 = Descending]
- &$a
Function to convert array to integer values
void
toInteger
( &$array, [mixed $default = null], array $array)
- array $array: The source array to convert
- mixed $default: A default value (int|array) to assign if $array is not an array
- &$array
Utility function to map an array to a stdClass object.
object The
toObject
( &$array, [ $class = 'stdClass'], array $array, string $calss)
- array $array: The array to map.
- string $calss: Name of the class to create
- &$array
- $class
void
toString
([ $array = null], [ $inner_glue = '='], [ $outer_glue = ' '], [ $keepOuterKey = false])
- $array
- $inner_glue
- $outer_glue
- $keepOuterKey
Private callback function for sorting an array of objects on a key
int
_sortObjects
( &$a, &$b, array $a, array $b)
- array $a: An array of objects
- array $b: An array of objects
- &$a
- &$b
Documentation generated on Sat, 14 Nov 2009 11:10:36 +0000 by phpDocumentor 1.3.1



JArrayHelper (Subpackage Utilities)
static