in reply to Class::DBI and a self-referencing many-to-many
It looks close to what you did. Not sure why mine worked and yours didn't.{ package My::Link; our @ISA = qw(My::DBI); __PACKAGE__->table('link'); __PACKAGE__->columns(Primary => qw(src dst)); __PACKAGE__->has_a(src => 'My::Page'); __PACKAGE__->has_a(dst => 'My::Page'); } { package My::Page; our @ISA = qw(My::DBI); __PACKAGE__->table('page'); __PACKAGE__->columns(All => qw(location state last_status last_checked last_good last_modified) +); __PACKAGE__->has_many(inbound => 'My::Link', 'dst', { sort => 'src' +}); __PACKAGE__->has_many(outbound => 'My::Link', 'src', { sort => 'dst' + }); }
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Class::DBI and a self-referencing many-to-many
by jgallagher (Pilgrim) on Sep 14, 2005 at 16:28 UTC |