You certainly can retrieve an array of objects. If Transfer didn't, it would
be far less useful. :)

In Transfer, you establish your relationships (or object compositions, in
some cases) in the Transfer XML config file. Here's an example...


<package name="car">

  <object name="Car" table="tbl_Cars">
   <id name="CarID" type="numeric" />
   <property name="Name" type="string" />

   <onetomany name="wheels">
      <link to="car.Wheels" column="Car_ID" />
      <collection type="array" />
   </onetomany>
  </object>

   <object name="Wheels" table="tbl_Wheels">
      <id name="WheelID" type="numeric" />
      <property name="Name" type="string" />
   </object>

</package>

In this case, tbl_Wheels has a FK to tbl_Cars called Car_ID.  To retreive an
array of wheels, you'd simply retrieve a Car from Transfer and call
getWheels().

car = transfer.get('car.Car",3);  // Used a fake PK of "3"

if( car.containsWheels() ) {
    dump( car.getWheelsArray() );
}

Some of that might be pseudo code off the top of my head.  Check out the
following 2 docs for more detailed info...

http://docs.transfer-orm.com/wiki/Managing_Relationships_and_Compositions.cfm
http://docs.transfer-orm.com/wiki/Generated_Methods.cfm

Jason Durham


On Tue, Oct 12, 2010 at 10: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. He seems to think it was possible but I can't find
> anything in the documentation. Could someone maybe give me some
> pointers please if it can be done?
>
> Thanks again,
> James
>
> --
> 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