SortTransform

Subclass this and implement the "sort" function to create a sort transform using your own criteria.

Defined (1)

The class is defined in the following location(s).

/SortTransform.php  
  1. abstract class SortTransform extends BaseTransform { 
  2.  
  3. public function getTransformedData() { 
  4. usort($this->data, array($this, 'sort')); 
  5. return $this->data; 
  6.  
  7. /** 
  8. * @param $a array: associative array of 1 form entry 
  9. * @param $b array: associative array of 1 form entry 
  10. * @return int -1 if a>b, 0 if a==b, 1 if a<b 
  11. */ 
  12. public abstract function sort($a, $b); 
  13.