Re: Working on a many-to-many CDBI::Relationship
[prev]
[thread]
[next]
[Date index for 2005/05/14]
On Fri, May 13, 2005 at 07:25:40PM -0500, Stepan Riha wrote:
> however my code adds it to the CDBI class but one would probably prefer it be
> added to the class that "uses" it (University::DBI, in my example).
> ---------------------------------------------------------------------
> package Class::DBI::Relationship::AssociatedWith;
> use base 'Class::DBI::Relationship';
> BEGIN {
> Class::DBI->add_relationship_type(
> associated_with => "Class::DBI::Relationship::AssociatedWith"
> );
> }
Why not just have the 'using' class do that directly?
package My::CDBI;
__PACKAGE__->add_relationship_type(
associated_with => "Class::DBI::Relationship::AssociatedWith"
);
That's how it's really meant to be done.
Tony
|
|
Re: Working on a many-to-many CDBI::Relationship
Tony Bowden 07:49 on 14 May 2005
|