Skip to content

Idea: use custom result iterators per tables to provide on-the-fly filtering #91

@moufmouf

Description

@moufmouf

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?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions