Hydrahon v1.1.11
This release fixes an error when trying to pass multiple expression to an order by statement:
$h->table('people')->select()
->orderBy([new Expression('rand()'), new Expression('rand()')])
->execute();
select * from `people` order by func1() asc, func2() asc
There is currently no way changing the direction per order statement in the array syntax. So the direction is set for all given order statements in the array.
$h->table('people')->select()
->orderBy([new Expression('func1()'), new Expression('func2()')], 'desc')
->execute();
select * from `people` order by func1() desc, func2() desc
The fix should also allow mixed arrays:
$h->table('people')->select()
->orderBy(['name' => 'asc', new Expression('func()')], 'desc')
->execute();
select * from `people` order by `name` asc, func() desc