[Catalyst] Model objects from multiple DBIx::Class rows

Stephen Shorrock stephen.shorrock at gmail.com
Thu Nov 22 15:59:15 GMT 2012


I was wondering whether there is any advice out there about how to use
and manage objects within a Catalyst application where the objects
contain DBIx::Class schema model objects that are also within the

I've considered creating simple moose objects that get passed the
schema objects and use rows returned from the schema objects to
populate 'local' values but this doesn't seem right. The trouble I
have is that data for these objects is stored in the database but
their i sno single table for the object them selves for example I
might have a Montage object that has a $User and several @Pictures the
User record is stored in the database and the Picture records are also
stored as individual rows in a pictures table. I want to manipulate
the users along with their pictures as an object them selves, for
example given a User DBIx::class objects create a method (eg
get_montage) that returns a Montage.

Is there a simple solution perhaps creating a DBIx::class object that
doesn't actually have an underlying table but can still utilize
relationships and have User::get_montage return an instance of one of
these?  Or am I overlooking something else that is obvious?

Thanks in advance


More information about the Catalyst mailing list