public function sort($callbackFunction)
    {
        $items = iterator_to_array($this, false);
        usort($items, $callbackFunction);

        /** @var \Tx_Oelib_Model $item */
        foreach ($items as $item) {
            $this->detach($item);
            $this->attach($item);
        }

        $this->markAsDirty();
    }
public function sort($callbackFunction)
    {
        $items = iterator_to_array($this, false);
        usort($items, $callbackFunction);

        /** @var \Tx_Oelib_Model $item */
        foreach ($items as $item) {
            $this->detach($item);
            $this->attach($item);
        }

        $this->markAsDirty();
    }
public function sort ( $ callbackFunction ) { $ items = iterator_to_array ( $ this , false ) ; usort ( $ items , $ callbackFunction ) ; /** @var \Tx_Oelib_Model $item */ foreach ( $ items as $ item ) { $ this -> detach ( $ item ) ; $ this -> attach ( $ item ) ; } $ this -> markAsDirty ( ) ; }
Sorts this list by using the given callback function.

The callback function, must take 2 parameters and return -1, 0 or 1.
The return value -1 means that the first parameter is sorted before the
second one, 1 means that the second parameter is sorted before the first
one and 0 means the parameters stay in order.

@param mixed $callbackFunction a callback function to use with the models stored in the list, must not be empty

@return void
Sorts this list by using the given callback function .