[Catalyst] still not sure if I have the hang of this ...

Matt S Trout dbix-class at trout.me.uk
Wed Dec 28 20:07:18 CET 2005


On Tue, Dec 27, 2005 at 11:43:43PM +0100, Andreas Marienborg wrote:
> >Now I want to take this data and stuff it into one of my model's  
> >tables.  I presume it is something like
> >
> >	__PACKAGE__->find_or_create({ key1 => $value1, key2 =>  
> >$value2, ...} );
> >
> 
> You usually have to replace __PACKAGE__ with the actual model- 
> package, like MyApp::Model::Table->find_or_create

Aieee, don't do that!

$c->model('Table') is better because that way you can move that controller
code into another app without having to trudge through a search-and-replace.

-- 
     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 Catalyst mailing list