aliroObjectSorter Class Reference

List of all members.

Public Member Functions

 __construct (&$a, $k, $sort_direction=1)
 aliroObjectCompare (&$a, &$b)

Public Attributes

 $_keyname = ''
 $_direction = 0
 $_object_array = array()

Private Member Functions

 sort ()


Detailed Description

Sorts an Array of objects

Definition at line 6 of file aliroObjectSorter.php.


Constructor & Destructor Documentation

aliroObjectSorter::__construct ( &$  a,
k,
sort_direction = 1 
)

Definition at line 11 of file aliroObjectSorter.php.

References sort().

00011                                                              {
00012         $this->_keyname = $k;
00013         $this->_direction = $sort_direction;
00014         $this->_object_array =& $a;
00015         $this->sort();
00016     }


Member Function Documentation

aliroObjectSorter::aliroObjectCompare ( &$  a,
&$  b 
)

Definition at line 19 of file aliroObjectSorter.php.

00019                                                   {
00020         $key = $this->_keyname;
00021         if ($a->$key > $b->$key) return $this->_direction;
00022         if ($a->$key < $b->$key) return -$this->_direction;
00023         return 0;
00024     }

aliroObjectSorter::sort (  )  [private]

Definition at line 26 of file aliroObjectSorter.php.

Referenced by __construct().

00026                              {
00027         usort($this->_object_array, array($this,'aliroObjectCompare'));
00028     }


Member Data Documentation

aliroObjectSorter::$_keyname = ''

Definition at line 7 of file aliroObjectSorter.php.

aliroObjectSorter::$_direction = 0

Definition at line 8 of file aliroObjectSorter.php.

aliroObjectSorter::$_object_array = array()

Definition at line 9 of file aliroObjectSorter.php.


The documentation for this class was generated from the following file:

Generated on Wed May 14 13:01:59 2008 for ALIRO by  doxygen 1.5.5