We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

proposal: Customize ResultSet Simple

Would be great if we can specify a subclass of resultSet Simple for some models.

of course it can be done with afterFetch etc, but this method is becoming the center of my models now, it is responsible of almost everything and I would like a way to delegate responsabilities like this one.

So, an especial method to define the subclass of ResultSets Simple returned will be great. This way we can implement custom logic to the ResultSets Simple.

The final result would be:

 $resultSetCustomized = ModelObject::find();
 // ResultSetCustomized becomes a custom resultSet class, example: MyOwnResultSet extends Simple;

If you have all your models extend one BaseModel-type class, then overwrite find() - then you'll be able to have this functionality in all your models just by writing one method.

I realize this isn't as simple as just configuring a model, but there are a ton of ways people could want to use this functionality - probably more than the coders want to worry about providing, especially since it is so easy to build the functionality yourself.