[Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) |
[eluser]OverZealous[/eluser]
First off, that query will always return 1. It cannot, and will not, ever return more than one. So that's part of the issue. Second, ->count has a slightly reduced functionality, in order to allow it to use the COUNT(*) method. Update: I should have mentioned you might have gotten a non-error result using: Code: $category = new Category(); I realize you are probably trying to see if the item exists. Another method for doing this is: Code: $exists = $user->category->where('id', $id)->select('id')->get()->exists(); Which I do realize isn't quite as clean or efficient as using count(). |
Welcome Guest, Not a member yet? Register Sign In |