[Dbix-class] more schema questions

Brandon Black blblack at gmail.com
Wed Jan 18 06:31:08 CET 2006


On 1/7/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
> On Sat, Jan 07, 2006 at 09:24:57PM +0000, Chisel Wright wrote:
> > On Sat, Jan 07, 2006 at 09:18:10PM +0000, Matt S Trout wrote:
> > > If you're hoping your Cat + DBIC app will eventually run multiple times
> > > under mod_perl with different configs, this is the way to do it :)
> >
> > I hadn't thought that far ahead, I was just thinking that the way I'm
> > doing it now isn't as portable.
> >
> > I've been doing:
> >
> > MyApp.pm:
> >
> > our $foo_class = 'MyApp::Model::MyDB::Foo'
> > # etc
> >
> > and using
> >
> > $MyApp::foo_class->search( ... );
> >
> >
> > Is the method you mentioned something new in the 5.x series? I don't
> > recall a $c->model() method, and it's sometimes hard to keep up with all
> > the changes. [This is where I look really stupid and find it's been
> > there for months...]
>
> ->model, ->view and ->controller were added in 5.50
>
> ->model('DBIC') is *mostly* equivalent to
>
> $c->comp('Model::DBIC') || $c->comp('M::DBIC');
>
> but I'll skip the details, since we appear to be on the wrong list :)
>

Back on the right list, is there any "correctness" differential between using

$db_class->class('Foo')->...

and

$db_class->table('foo')->...

or is it just a matter of whichever namespace is easier for you to
remember the names in?

-- Brandon



More information about the Dbix-class mailing list