Re: [CDBI] M-M relationships and values in the mapping table
"Perrin Harkins" <[email protected]> Wed, 5 Dec 2007 08:23:21 -0500
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
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