| Handel documentation | Contained in the Handel distribution. |
Catalyst::Helper::Model::Handel::Order - Helper for Handel::Order Models
script/create.pl model <newclass> Handel::Order <dsn> [<username> <password>]
script/create.pl model Order Handel::Order dbi:mysql:localhost myuser mysecret
A Helper for creating models based on Handel::Order objects.
Makes a Handel::Order Model class for you.
Makes a Handel::Order Model test for you.
Christopher H. Laco
CPAN ID: CLACO
claco@chrislaco.com
http://today.icantfocus.com/blog/
| Handel documentation | Contained in the Handel distribution. |
# $Id$ package Catalyst::Helper::Model::Handel::Order; use strict; use warnings; BEGIN { use Catalyst 5.7001; };
sub mk_compclass { my ($self, $helper, $dsn, $user, $pass) = @_; my $file = $helper->{file}; my $app = $helper->{app}; $helper->{'dsn'} = $dsn || ''; $helper->{'user'} = $user || ''; $helper->{'pass'} = $pass || ''; if ($helper->{'handel_auto_wire_models'}) { $helper->{'handel_auto_wireup'} = "order_class => '$app\:\:Order',\n "; }; return $helper->render_file('model', $file); };
sub mk_comptest { my ($self, $helper) = @_; my $test = $helper->{'test'}; return $helper->render_file('test', $test); };
1; __DATA__
1; __test__ use Test::More tests => 2; use strict; use warnings; BEGIN { use_ok('Catalyst::Test', '[% app %]'); use_ok('[% class %]'); }; __END__