Re: [CDBI] M-M relationships and values in the mapping table
"Arshavir Grigorian" <[email protected]> Wed, 5 Dec 2007 12:47:21 -0800
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
On Dec 5, 2007 5:23 AM, Perrin Harkins <[email protected]> wrote: > On Dec 5, 2007 2:54 AM, Arshavir Grigorian <[email protected]> wrote: > > I am looking at the following code snippet on the > > http://wiki.class-dbi.com/wiki/Complex_many_to_many page. > > > > my $story = Story->retrieve($id); > > foreach my $image ( $story->images ) { > > printf "%d -> %s [%s]", $image->priority, > > $image->image->file_name, $image->image->caption; > > } > > In that example, the has_many method images() actually returns > StoryImage objects, not Image objects. That's why priority() is a > valid call on them. > > - Perrin > Ah. Makes sense now. Thanks, Perrin.