[Dbix-class] more schema questions

Matt S Trout dbix-class at trout.me.uk
Sat Jan 7 22:50:01 CET 2006


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 :)

-- 
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list