Ok, I've done this and without actually touching the reactor source code.
I've attached a file called gatewayHelper.cfm. You can place this file in 1 of 2 places:
- Place it in ScratchData/Gateway and include it in the TableNameGateway.cfc files you wan to use getAllAsObjects()
- Place it in reactor/base and include gatewayHelper in abstractGateway.cfc to let all tables have this function by default.
Example Code
<cfset userRecord= Reactor.createRecord("Users") />
<cfset records = Reactor.createGateway('Users').getAllAsObjects(userRecord) />
<cfloop from="1" to="#Arraylen(records)#" index="i">
<div>
#records[i].getID()# -
#records[i].getFirstName()#
#records[i].getLastName()#
</div>
</cfloop>
What you get as a result is an array of Reactor record objects.
WHAT'S THE ADVANTAGE?
In ScratchData/Record/userRecord.cfc, you can add a function called getAge() that may calculate a person's age based on their birthday in the database. When you iterate through the record set, getAge() is avalialbe for you to use as a read-only property (no setter needed).
And for those of you who use ColdSpring or any other IoC framework, the first line in the example code won't even be necessary.
To all of you who have worked on Reactor, you've done a really nice job! Enjoy!
-Dutch