JArrayHelper
Description
JArrayHelper is an array utility class for doing all sorts of odds and ends with arrays.
Located in /joomla/utilities/array.php (line 24)
JArrayHelper (Subpackage Utilities)
Method Summary
static mixed
getValue
( &$array, string $name, [mixed $default = null], [string $type = ''], array $array)
Methods
fromObject (line 87)
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
getColumn (line 127)
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
getValue (line 159)
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
sortObjects (line 227)
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
toInteger (line 35)
Function to convert array to integer values
array
toInteger
( &$array, [int $default = null], array $array)
- array $array: The source array to convert
- int $default: A default value to assign if $array is not an array
- &$array
toObject (line 59)
Utility function to map an array to a stdClass object.
object The
toObject
( &$array, [ $toJObject = false], array $array, boolean $jobject)
- array $array: The array to map.
- boolean $jobject: Optionally create a JObject
- &$array
- $toJObject
_sortObjects (line 249)
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 Mon, 05 Mar 2007 20:52:23 +0000 by phpDocumentor 1.3.1