We could generate custom iterators per table that can be customized by users to offer "on the fly filtering".
It could work like this:
$users = $userDao->findAll()->filterActiveUsers()->filterAdults();
Behind the scene, the findAll() method returns a UserResultIterator (instead of a simple ResultIterator). The UserResultIterator has been coded by the developer (I'm not sure exactly how yet...)
Maybe something like:
class UserResultIterator extends ResultIterator {
public function filterActiveUsers() : ResultIterator {
return $this->andSqlFilter('active = 1');
}
}
You think this is a good idea?