Skip to main content
Known Participant
April 18, 2011
Question

newbie: joined tables recordset

  • April 18, 2011
  • 2 replies
  • 699 views

Hello,

I have two artists, and I want to gather all the pictures of these artistis, but I don't know how to get there.

artist = entityload("artists");

art = artist.getPictures(); // doesnt work, "the getPictures method was not found"

Thank you for any suggestion    

This topic has been closed for replies.

2 replies

Inspiring
April 18, 2011

What is the object schema of each of the entities you mention here? ie: the CFCs that define them.

--

Adam

SilvestroAuthor
Known Participant
April 19, 2011

The two Cfcs, actually 'users' and 'items', are related by way of this property:

user.cfc:

<cfproperty name="item" fieldtype="one-to-many" cfc="items" fkcolumn="userfk" singularname="item" cascade="delete">

item.cfc:

<cfproperty name="user" fieldtype="many-to-one" cfc="users" singularname="user" fkcolumn="userfk">

Thanks!!!

Owainnorth
Inspiring
April 18, 2011

You'll probably need to create a new pictures array, then loop through all your Artist objects one by one, appending their Pictures to your first array.

Or just look into standard array functions, you can probably do an ArrayAppend() or something similar.