<cfset Employee = Reactor.createRecord("Employee")>
<cfset Employee.setProperties(form).save()>
OR
<cfset Employee = Reactor.createRecord("Employee").load(EmployeeID =
form.EmployeeID)>
<cfset Employee.setProperties(form).save()>
The idea is that setProperties would loop through the fieldnames in
the table, and if a corresponding key existed in the structure that's
being passed, it would set that property.
-Dutch
ColdBox has a BeanFactory plugin that can do just that.
Something like:<cfset Employee = reactor.createRecord("Employee")><cfset Employee = getPlugin("beanFactory").populateBean(Employee)>You could probably take a look the plugin and write your own helper for your application to do the same thing without the framework.
Ace idea, one for the list.
--
Tom
Has anyone added it to trac.reactorframework.org yet ?
--
Tom
At the mo. I'm just marking them as 'enhancment' in trac, is that OK
in the mean time ?
--
Tom