James,
On Tue, Oct 12, 2010 at 11:27 AM, Clarkee21 <[email protected]> wrote:
> ... was talking to someone about a month ago about Transfer and how it
> always seems to return a query result rather than build an array of
> Transfer objects.
Jason is correct. If you have a parent object and have a relationship
defined, you can retrieve an array of child objects (if you've defined the
collection as an array).
But I think you have something different in mind. I suspect you're not
dealing with a relationship, but rather simply want an array of objects at
any given time.
There's no core method in Transfer to do something like:
transfer.getArray("user.user").
Rather, what you want to do is retrieve the query list --
transfer.list("users.user") -- or listByPropery or listByPropertyMap. This
will, as you state, return a query. Then you loop over the list of IDs,
creating an object matching each ID, and add them to an array.
Something like:
<cfset var users = transfer.list("users.user") />
<cfset var userArray = arrayNew(1) />
<cfset var user = "" />
<cfif users,recordCount GT 0>
<cfloop query="users">
<cfset user = transfer.get("users.user",users.UserID) /> (This
creates the object)
<cfset arrayAppend(userArray,user) />
</cfloop>
</cfif>
<cfreturn userArray />
Make sense?
--
Thanks,
Tom
Tom McNeer
MediumCool
http://www.mediumcool.com
1735 Johnson Road NE
Atlanta, GA 30306
404.589.0560
--
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer
Try out the new Transfer ORM Custom Google Search:
http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8
You received this message because you are subscribed to the Google Groups
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/transfer-dev?hl=en