What Tom suggested is what I do if the number of objects is low.  However,
if a user may have a 100 applications, you might be introducing additional
overhead to simply output a list of applications.  In that case, I'd create
a different method on your decorator called listApplications() which used
TQL (or even SQL) to return a query object.

Jason Durham


On Thu, Sep 9, 2010 at 12:48 PM, Tom McNeer <[email protected]> wrote:

> Hi Marc,
>
> From my experience, I would say the best way to deal with your situation is
> more or less as follows:
>
> Create a "getUserApplications" method of some sort, with the user as an
> argument.
>
> Within that method, determine whether or not the user is an admin.
>
> <cfif admin>
>
> Call another method, "getAdminApplications." Within the method, create an
> empty array (say, "arAdminApps"). Run your "list()" method, then loop over
> the resulting query, using the id for each application to create a Transfer
> object (transfer.get(), and adding the object to the array, which you return
> to your calling method.
>
> <cfelse>
>
> Do what you're now doing: retrieve the array from the many-to-many
> association.
>
> The need to create an array of Transfer objects is pretty common, and it
> seems that doing list(), then building the array, is the simplest way.
>
> --
> 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]<transfer-dev%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/transfer-dev?hl=en
>

-- 
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

Reply via email to