My first thought was that you just create one record object for the
permission table.  If you know the userID, you load up the permission record
and then save the record.  I believe there is a method on the record object
that clears out the data.  So in essence, you just loop over the array, load
the reocrd object up and save them and then at the end of the loop you clean
up the record object.

This really prevents create anymore than one record object for the
permissions table.

Teddy

On 12/7/06, Derek Perez <[EMAIL PROTECTED]> wrote:

Hey everyone,

hope you all are having a productive week. I am in the process of writing
a user account system with reactor....and I am somewhat stuck on a
conceptual level of how I should accomplish this task. I have a "user"
table, a "permission" table, and a "userPermissionJoin" table. There is a
list of permissions that a user from the user table can have from the
permissions table (thus the need for the userPermissionJoin table). Hope
that makes sense...so heres the issue:

I saw the documentation on how to add:

<!--- create a customerRecord --->
<cfset CustomerRecord = Reactor.createRecord("Customer") />

<!--- get the user record's address --->
<cfset AddressRecord = CustomerRecord.getAddress() />

<!--- populate the customer and address --->
<cfset CustomerRecord.setUsername("jblow") />
<cfset CustomerRecord.setPassword("9ummy") />
<cfset CustomerRecord.setFirstName("Joe") />
<cfset CustomerRecord.setLastName("Blow") />

<cfset AddressRecord.setStreet1("1234 Left Turn Ln.") />
<cfset AddressRecord.setCity("Albuquerque") />
<cfset AddressRecord.setState("New Mexico") />
<cfset AddressRecord.setZip("87112") />

<!--- save the customer and address! --->
<cfset CustomerRecord.save() />

okay fine and good, but what happens if I have a list or an array of
permission ID's that I need to have appended to a single user record? can
someone help me try to understand what the best method of handling this is?
Thanks so much for your help!! have a great day!

- Derek


--
  Derek Perez
  [EMAIL PROTECTED]


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --




--
<cf_payne />
Adobe Certified ColdFusion MX 7 Developer
Atlanta CFUG (ACFUG): http://www.acfug.org


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to