[Dbix-class] "Alias" schema option
Christopher H. Laco
claco at chrislaco.com
Mon Apr 3 17:53:40 CEST 2006
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')...
-=Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20060403/70a15c4f/attachment.pgp
More information about the Dbix-class
mailing list