PHP Doctrine: filtering data which is already loaded?
- by ropstah
I'm new to Doctrine and ActiveRecord.
How should I filter a table after it has been loaded? (i suppose this is preferred over sending multiple queries?)
Is this 'good' or 'bad'?
class UserTable extends Doctrine_Table {
function filterByGroup($group) {
$ut = new UserTable();
foreach($this as $u) {
if($u->group = $group) $ut->add($u);
}
return $ut;
}
}