Commit c674abdc authored by Ghislain Loas's avatar Ghislain Loas

refactor order by parsing implementation

parent d5b643d2
......@@ -144,7 +144,7 @@ class Storm_Model_PersistenceStrategy_Volatile extends Storm_Model_PersistenceS
if (is_array($select))
$select = implode(',', $select);
xdebug_break();
usort($result, $this->compareFunction($select));
return $result;
}
......
......@@ -31,9 +31,9 @@ class Storm_Model_PersistenceStrategy_Volatile_OrderClause {
$_next_clause = null;
public static function parseOrderClause($order) {
$clauses = array_filter(explode(',', strtolower($order)));
$clauses = array_reverse(array_filter(explode(',', strtolower($order))));
$first_clause = new static(array_pop($clauses));
$first_clause = new static(array_shift($clauses));
foreach($clauses as $clause) {
$first_clause = new static($clause, $first_clause);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment