Kohanav3 ORM: calling where->find_all twice

Posted by David Lawson on Stack Overflow See other posts from Stack Overflow or by David Lawson
Published on 2010-06-10T09:17:30Z Indexed on 2010/06/10 9:23 UTC
Read the original article Hit count: 310

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about php

Related posts about kohana-3