It’s clear - to make null values on top can be used that SQL:
ORDER BY date_end IS NULL DESC, date_end DESCand here is how to pas that SQL order in CakePHP:
array('date_end' => 'IS NULL DESC', 'Model.date_end' => 'DESC')
Here is few things you should keep in mind:
1) if you just write date_end IS NULL as string, CakePHP will fail with error ‘date_end IS NULL’ column not found, thats why we have that array to pass order fields;
2) the second parameter is Model.date_end, because is you make it just date_end CakePHP will ignore it because date_end is already in array of sorted fields.
That’s all, happy coding.