[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/libraries/joomla/utilities/ -> arrayhelper.php (summary)

(no description)

Copyright: Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
License: GNU/GPL, see LICENSE.php
Version: $Id: arrayhelper.php 14401 2010-01-26 14:10:00Z louis $
File Size: 286 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

JArrayHelper:: (8 methods):
  toInteger()
  toObject()
  toString()
  fromObject()
  getColumn()
  getValue()
  sortObjects()
  _sortObjects()


Class: JArrayHelper  - X-Ref

JArrayHelper is an array utility class for doing all sorts of odds and ends with arrays.

toInteger(&$array, $default = null)   X-Ref
Function to convert array to integer values

param: array    $array        The source array to convert
param: mixed    $default    A default value (int|array) to assign if $array is not an array

toObject(&$array, $class = 'stdClass')   X-Ref
Utility function to map an array to a stdClass object.

param: array    $array        The array to map.
param: string    $calss         Name of the class to create
return: object    The object mapped from the given array

toString( $array = null, $inner_glue = '=', $outer_glue = ' ', $keepOuterKey = false )   X-Ref
No description

fromObject( $p_obj, $recurse = true, $regex = null )   X-Ref
Utility function to map an object to an array

param: object    The source object
param: boolean    True to recurve through multi-level objects
param: string    An optional regular expression to match on field names
return: array    The array mapped from the given object

getColumn(&$array, $index)   X-Ref
Extracts a column from an array of arrays or objects

param: array    $array    The source array
param: string    $index    The index of the column or name of object property
return: array    Column of values from the source array

getValue(&$array, $name, $default=null, $type='')   X-Ref
Utility function to return a value from a named array or a specified default

param: array    $array        A named array
param: string    $name        The key to search for
param: mixed    $default    The default value to give if no key found
param: string    $type        Return type for the variable (INT, FLOAT, STRING, WORD, BOOLEAN, ARRAY)
return: mixed    The value from the source array

sortObjects( &$a, $k, $direction=1 )   X-Ref
Utility function to sort an array of objects on a given field

param: array    $arr        An array of objects
param: string    $k            The key to sort on
param: int        $direction    Direction to sort in [1 = Ascending] [-1 = Descending]
return: array    The sorted array of objects

_sortObjects( &$a, &$b )   X-Ref
Private callback function for sorting an array of objects on a key

param: array    $a    An array of objects
param: array    $b    An array of objects
return: int        Comparison status



Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1