[Dbix-class] Schema::Loader and has_many

Vsevolod (Simon) Ilyushchenko simonf at cshl.edu
Wed Mar 22 16:05:55 CET 2006


Thanks! It works now. So what is the purpose of even having the M tree? 
Just deceiving Catalyst into thinking that there is a model after all?

Simon


>>The nice thing about doing it this way (with the Schema existing
>>completely outside Catalyst, and the model just loading it) is that if
>>you have other tools besides Catalyst that need to access the database
>>(like admin scripts and cronjobs for example), they can just load up
>>the schema and have the same level of access to the database.
>>
> 
> 
> Also, if you're using the Schema::Loader, the external table-class
> add-on definitions don't really need the standard setup code.  They
> can just be like:
> 
> package Test::Schema::SomeClass;
> __PACKAGE__->has_many(somethings => 'Test::Schema::SomeThing');
> 1;
> 
> Because by the time they are loaded, this class name already exists in
> memory and already has the correct base classes and all.

-- 

Simon (Vsevolod ILyushchenko)   simonf at cshl.edu
				http://www.simonf.com

"Think like a man of action, act like a man of thought."

		         Henri Bergson



More information about the Dbix-class mailing list