[CDBI] has_many inflate?

Christopher H. Laco claco at chrislaco.com
Tue Aug 9 00:48:52 BST 2005


Do all of the reltionships support inflate?

Currently I've got an old 3-argument style has_many:


> __PACKAGE__->has_many(_items => 'Handel::Order::Item', 'orderid');

I want to specify an inflate in a secondary has_many [to turn off 
autoupdates in rare circumstances] and still keep that foreign key field 
name argument, but I'm not having any luck.

> __PACKAGE__->has_many(_items => 'Handel::Order::Item', 'orderid');
> __PACKAGE__->has_many(_items_no_update => 'Handel::Order::Item', inflate => 'new_autoupdateoff', 'orderid');


> #     Error:  Can't use string ("new_autoupdateoff") as a HASH ref while "strict refs" in
 > use at C:/Development/Perl/584/site/lib/Class/DBI/Relationship/H
> asMany.pm line 40.

I guess I could just subclass Handel::Order::Item into 
Handel::Order::NoupdateItem, turn off autoupdates in that subclass and do:

> __PACKAGE__->has_many(_items => 'Handel::Order::Item', 'orderid');
> __PACKAGE__->has_many(_items_no_update => 'Handel::Order::NoupdateItem', 'orderid');


What am I missing?

Thanks,
-=Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3178 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.digitalcraftsmen.net/mailman/private/classdbi/attachments/20050808/1734782c/smime.bin


More information about the ClassDBI mailing list