[Dbix-class] Proxy classes and source name.

Bill Moseley moseley at hank.org
Thu Nov 18 00:21:19 GMT 2010


Looking at:

http://search.cpan.org/~frew/DBIx-Class-0.08124/lib/DBIx/Class/Manual/Cookb=
ook.pod#Dynamic_Sub-classing_DBIx::Class_proxy_classes

Both the User and Admin classes have the same source,
so $row->result_source->source_name always returns 'User'.

Is there a way to set the source on the Admin class so that
$user->result_source->source_name still returns 'User' but
$admin->result_source->source_name returns 'Admin'?

Or is it better to create a method in the base result class, say,
$row->class_moniker that pulls the name out of the row's class?



-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20101117/20f=
3e5d9/attachment.htm


More information about the DBIx-Class mailing list