[CDBI] Redefine has_many relationship
Christopher H. Laco
claco at chrislaco.com
Sat Sep 17 20:34:43 BST 2005
What's the easiest way to redefine a has_many relationship?
I have Cart/Item classes. Cart is setup with:
__PACKAGE__->has_many(_items => 'Cart::Item', 'cart');
Now, if someone subclasses Cart, they also presumable want to subclass
Cart::Item as well. This, however, doesn't work:
use base 'Cart::Item';
use base 'Cart';
__PACKAGE__->has_many(_items => 'CustomCart::CustomItem', 'cart');
_items method already exists in CustomCart. I've tried all sorts of
symbol table hackery, but nothing works thus far.
What's the solution to this?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3178 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.digitalcraftsmen.net/mailman/private/classdbi/attachments/20050917/37db9dd9/smime.bin
More information about the ClassDBI