Skip to content

Instantly share code, notes, and snippets.

@lorenzo
Created March 3, 2015 20:00
Show Gist options
  • Save lorenzo/78c89a0a176410c68db9 to your computer and use it in GitHub Desktop.
Save lorenzo/78c89a0a176410c68db9 to your computer and use it in GitHub Desktop.
default_order.php
public function beforeFind ($event, $query, $options, $primary) {
$order = $query->clause('order');
if ($order === null || !count($order)) {
$query->order('my_column');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment