[Catalyst] how to reuse Catalyst Schema for non-web purposes?
kakimoto at tpg.com.au
kakimoto at tpg.com.au
Thu Apr 23 03:48:49 GMT 2009
Hello Kieren,
thank you for the link,
http://blog.hide-k.net/archives/2008/10/dbixclassresult_1.php.
Please correct me if I am wrong.
Say if I have a Schema file, Schema/Subscriptions.pm
After the section, "DO NOT MODIFY ANYTHING ABOVE THIS! ",
I start declaring functions (not methods).
sub is_trial_period
{
# evaluate if trial period is over or not
# as this has to be determined through a set
# of business rules.
...
}
sub is_promo_period
{
# evaluate if promo period is still on or not
# as this has to be determined through a set
# of business rules.
...
}
Have I got the right idea?
Thank you.
K. akimoto
Quoting Kieren Diment <kieren at diment.org>:
>
> On 23/04/2009, at 12:59 PM, kakimoto at tpg.com.au wrote:
>
> >> From the Catalyst tutes, I seem to get the impression that pretty
>
> >> much a
> > lot of the business logic is done in the controller.
> >
> > I might be wrong but in
> >
>
http://search.cpan.org/~hkclark/Catalyst-Manual-5.7020/lib/Catalyst/Manual/Tutorial/BasicCRUD.pod#___top
> > ("Add a Method to Process Form Values and Update Database"),
> > it seems that the task of creating a new entry for books in the
> > database
> > and establishing the right relationships to the book_authors db
> table
> > is done in the sub form_create_do in the Controller.
> >
> > i suppose if a batch script were to be used to add in amany books,
> the
> > logic there would be trapped in the controller.
> >
> > How do we put that logic into the Model? very interesting and I
> would
> > like to hear more since I cant find any examples for putting
> business
> > logic in the Model for catalyst on google.
> >
>
> This: http://blog.hide-k.net/archives/2008/10/dbixclassresult_1.php
>
> is the blog post that I worked it out in, despite the text being in a
>
> language I don't speak :)
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
>
More information about the Catalyst
mailing list