fititnt - Especialista e Desenvolvedor Joomla! Visit fititnt.org, and look for some extension or more Joomla Framework info Joomla-Framework
Utilities
[ class tree: Joomla-Framework ] [ index: Joomla-Framework ] [ all elements ]

Class: JArrayHelper

Source Location: /libraries/joomla/utilities/arrayhelper.php

Class JArrayHelper

Class Overview

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

Located in /libraries/joomla/utilities/arrayhelper.php [line 21]



		
				Author(s):
		
Information Tags:
Since:  1.5

Methods

[ Top ]
Method Summary
static array   fromObject()   Utility function to map an object to an array
static array   getColumn()   Extracts a column from an array of arrays or objects
static mixed   getValue()   Utility function to return a value from a named array or a specified default
static array   sortObjects()   Utility function to sort an array of objects on a given field
static void   toInteger()   Function to convert array to integer values
static object The   toObject()   Utility function to map an array to a stdClass object.
static void   toString()  
static int   _sortObjects()   Private callback function for sorting an array of objects on a key

[ Top ]
Methods
static method fromObject  [line 111]

  static array fromObject( object The $p_obj, [boolean $recurse = true], [string $regex = null]  )

Utility function to map an object to an array

Parameters:
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

API Tags:
Return:  The array mapped from the given object

Information Tags:
Since:  1.5

[ Top ]
static method getColumn  [line 151]

  static array getColumn( &$array, string $index, array $array  )

Extracts a column from an array of arrays or objects

Parameters:
array   $array:  The source array
string   $index:  The index of the column or name of object property
   &$array: 

API Tags:
Return:  Column of values from the source array

Information Tags:
Since:  1.5

[ Top ]
static method getValue  [line 183]

  static mixed getValue( &$array, string $name, [mixed $default = null], [string $type = ''], array $array  )

Utility function to return a value from a named array or a specified default

Parameters:
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: 

API Tags:
Return:  The value from the source array

Information Tags:
Since:  1.5

[ Top ]
static method sortObjects  [line 251]

  static array sortObjects( &$a, string $k, [int $direction = 1], array $arr  )

Utility function to sort an array of objects on a given field

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

API Tags:
Return:  The sorted array of objects

Information Tags:
Since:  1.5

[ Top ]
static method toInteger  [line 31]

  static void toInteger( &$array, [mixed $default = null], array $array  )

Function to convert array to integer values

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

Information Tags:
Since:  1.5

[ Top ]
static method toObject  [line 58]

  static object The toObject( &$array, [ $class = 'stdClass'], array $array, string $calss  )

Utility function to map an array to a stdClass object.

Parameters:
array   $array:  The array to map.
string   $calss:  Name of the class to create
   &$array: 
   $class: 

API Tags:
Return:  object mapped from the given array

Information Tags:
Since:  1.5

[ Top ]
static method toString  [line 76]

  static void toString( [ $array = null], [ $inner_glue = '='], [ $outer_glue = ' '], [ $keepOuterKey = false]  )

Parameters:
   $array: 
   $inner_glue: 
   $outer_glue: 
   $keepOuterKey: 


[ Top ]
static method _sortObjects  [line 273]

  static int _sortObjects( &$a, &$b, array $a, array $b  )

Private callback function for sorting an array of objects on a key

Parameters:
array   $a:  An array of objects
array   $b:  An array of objects
   &$a: 
   &$b: 

API Tags:
Return:  Comparison status
See:  JArrayHelper::sortObjects()

Information Tags:
Since:  1.5

[ Top ]

The site fititnt.org is not affiliated with or endorsed by the Joomla! Project or Open Source Matters. If you are looking for official documentation, visit api.joomla.org and docs.joomla.org.
Documentation generated on Mon, 26 Oct 2009 23:04:32 -0200 by phpDocumentor 1.4.3