Hello,
It seems that when doing a count() and we have where() conditions they're just ignored...
It's absolutely conter-intuitive.
Why would Model_Something::find()->where('category_id', 1)->count() would count ALL the rows from the table and not only the rows where category_id = 1? Is that something planned to resolve this?
i have same problem
i try this page to get 1.1-dev: https://github.com/fuel/orm/tree/1.1/develop
but github gives me this file:
fuel-orm-v1.0-44-g03cd723.tar.gz
the problem still exists with this version
where i can find 1.1-dev?
Ok more information about this. I see I've been a bit rude in my last message, sorry for that. :'(
It works when the conditions are on the original table from the model.
It doesn't work when conditions are on related model.
My use-case is pretty easy: I have a Model_Blog and a Model_Category models. Model_Blog is related to Model_Category with a many_to_many relationship. I want to count the number of blog posts from one or many categories. I can't find whether it's possible or not using the ORM.