Christopher H. Laco wrote:
> Christopher H. Laco wrote:
>> While working on the Handel conversion to DBIC, I've come across the
>> need to have my resultsets always be "Carts" and "Items" regardless of
>> what the actual packages are named.
>>
>> For now, I've simply created a register_cart_classes() method that calls
>> register_class and sets the appropriate generic $monkier. Unfortunately,
>> that means I can't use load_classes() and whatever magic it may contain.
>>
>> Would there be any interest in adding something to ResultSource:
>>
>> package My::Schema::Foo;
>> __PACKAGE__->table('foo');
>> __PACKAGE__->alias('Cart')
>> # or
>> __PACKAGE__->moniker('Cart');
>>
>>
>> Then, after load_classes and connect(), we have:
>>
>> $schema->resultset('Cart')...
>>
>> instead of:
>>
>> $schema->resultset('Foo')...
>
> The only change is basically this to load_classes:
>
> push(@to_register, [ $comp_class->moniker || $comp, $comp_class ]);
>
> And of course, adding an moniker/alias accessor to ResultSource(Proxy)...
signature.asc
Description: OpenPGP digital signature
_______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
