Dan, Thanks for your suggestion. FYI, there are already other ways to accomplish this. For example, see the attached CFC (which I stole out of Model-Glue).
This will do exactly what you want. You simply init the CFC with a collection, in your case the form scope. You then call MakeBean() and pass in your record. The CollectionBeanMaker will take any elements out of your collection and use them to call setters on your record. For example, if your form had an element, firstName it would look for setFirstName on your record. If this exists it'll pass firstName into setFirstName. Pretty simple, eh? Doug -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Short Sent: Tuesday, February 28, 2006 7:12 PM To: [email protected] Subject: [Reactor For CF] Cutting out Repetive setXXX(FORM.XXX) I've perused the Reactor docs and haven't seen anything that might lead me to believe this is possible, but what I'd like to do is pass a Record a FORM scope and have it run all of the set business. So if I want to update a User I don't have to do this: <cfset User.setFirstName(FORM.FirstName) /> <cfset User.setLastName(FORM.LastName) /> ... <cfset User.Save() /> Is there any built-in functionality to do this? <cfset User.setInstance(FORM) /> <cfset User.Save() /> Or even: <cfset User.Save(FORM) /> If that's not in there by default, I don't think it would be terribly difficult for me to add myself. This would be done in the UserGateway.cfc in my site folder correct? Dan -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/ -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/
CollectionBeanMaker.cfc
Description: application/cfc

