[Dbix-class] Relationship delegated accessors using DBIC
Matt Whipple
matt at mattwhipple.com
Mon Aug 3 13:47:25 GMT 2009
Is there any built in functionality in DBIC to allow a relationship to
be defined so that the foreign fields can be accessed as though in the
present class?
I presently have part of an application that is using to tables with a
one to one relationship. One contains user information and the other
contains the application specific data for the users (contracts). All
of the relationships seem to be working and I can access the member
information through a, for example, $contract->member->first_name call,
but would like the higher level code to be able to treat all of the data
as simple, uniform accessors (i.e. $contract->first_name). I'm
presently using methods for each column within the Result class but was
hoping there was an option within the relationship definition similar to
a Moose 'handles'...is there some incarnation of the proxy() method that
will do this or any other existing solution?
More information about the DBIx-Class
mailing list