[CDBI] M-M relationships and values in the mapping table
"Arshavir Grigorian" <[email protected]> Tue, 4 Dec 2007 23:54:40 -0800
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
Hi,
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;
}
where "priority" is a column in the mapping table - StoryImages.
However, when I try to do the same, I get an error that "priority"
does not exist in the Image table, which it doesn't. I printed the
$story->images and got an aref of Image objects. I am wondering if I
need to declare anything extra to be able to access this field through
an Image object.
Thanks.