Kohanav3 ORM: calling where->find_all twice
- by David Lawson
When I do something like the following:
$site = ORM::factory('site')->where('name', '=', 'Test Site')->find();
$users = $site->users;
$deletedusers = $users->where('deleted', '=', '1')->find_all();
$nondeletedusers = $users->where('deleted', '=', '0')->find_all();
The contents of $deletedusers is correct, but the $nondeletedusers contains every non-deleted user, not just the ones in the loaded $site.
What am I doing wrong?