Closed osam closed 12 years ago
That is very odd, where() and order_by() are methods of the Query object, and so is count().
Can you do a \Debug::dump($query) and see what it is (it should be an instance of \Orm\Query).
It wasn't a bug. I had ->get(); at the end.
The docs say:
$query = Model_Article::find()->where('category_id', 1)->order_by('date', 'desc');
// We want to know the total number of articles for pagination $number_of_articles = $query->count();
http://docs.fuelphp.com/packages/orm/crud.html
That gives ErrorException [ Error ]: Call to a member function count() on a non-object. However, this does work:
Model_Article::count();