Reputation: 619
today my question is more about style than about programming...
I'm starting with PhalconPHP and I'm very surprised by its power, but there's a little trouble when I do use the find function to get all the results.
When I do this
$categories = Category::find('ORDER BY name DESC');
I get a mysql error about misspelling (because it assumes I want use a WHERE), so I have to do this:
$categories = Category::find('1=1 ORDER BY name DESC');
Which I consider tricky and absurd, there's a way to do what I want with no "tricks"?
Upvotes: 0
Views: 1535
Reputation: 12776
You can use an array as an argument for find()
, e.g.:
Category::find(array('order'=>'name DESC', 'limit'=>10));
Upvotes: 5