[Dbix-class] Emulating CDBI "temp" columns
Drew Taylor
taylor.andrew.j at gmail.com
Fri Jul 21 17:45:45 CEST 2006
On 7/21/06, Brandon Black <blblack at gmail.com> wrote:
> On 7/21/06, Drew Taylor <taylor.andrew.j at gmail.com> wrote:
> > 2) I'm using DBIC w/ Catalyst, and thus am using C::P::DBIC::Schema
> > (latest version - no Loader). I'd like to have a base class common for
> > all my table objects (ie. a common toJSON() method), but can't figure
> > out how to do it in conjunction w/ the C::P::DBIC::Schema plugin.
> >
> > At first I just tried having My::Schema::User inherit directly from
> > My::Schema::BaseClass, but that makes DBIC barf on Catalyst startup.
>
> It shouldn't - I'm using just such a setup myself. All of my source
> classes inherit from various other base classes.
I knew I couldn't be the only one. :-)
> Just to be sure we've got this straight:
>
> Check that...
>
> My::Schema ISA DBIx::Class::Schema
> My::Schema::User ISA My::Schema::BaseClass
> My::Schema::BaseClass ISA DBIx::Class
> My::Schema->resultset('User') ISA DBIx::Class::ResultSet
> My::Schema->resultset('User')->find('joebob') ISA My::Schema::User
> My::Schema->resultset('User')->find('joebob')->toJSON works?
I'm 99.9% sure that is how I have it setup. I'll double check later
this evening when I get home.
Thanks,
Drew
--
----------------------------------------------------------------
Drew Taylor * Web development & consulting
Email: drew at drewtaylor.com * Site implementation & hosting
Web : www.drewtaylor.com * perl/mod_perl/DBI/mysql/postgres
----------------------------------------------------------------
More information about the Dbix-class
mailing list