On 7/21/06, Brandon Black <[EMAIL PROTECTED]> wrote:
> On 7/21/06, Drew Taylor <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] * Site implementation & hosting
Web : www.drewtaylor.com * perl/mod_perl/DBI/mysql/postgres
----------------------------------------------------------------
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/