Catalyst::Helper::Model::Handel::Cart - Helper for Handel::Cart Models


Handel documentation Contained in the Handel distribution.

Index


Code Index:

NAME

Top

Catalyst::Helper::Model::Handel::Cart - Helper for Handel::Cart Models

SYNOPSIS

Top

    script/create.pl model <newclass> Handel::Cart <dsn> [<username> <password>]
    script/create.pl model Cart Handel::Cart dbi:mysql:localhost myuser mysecret

DESCRIPTION

Top

A Helper for creating models based on Handel::Cart objects.

METHODS

Top

mk_compclass

Makes a Handel::Cart Model class for you.

mk_comptest

Makes a Handel::Cart Model test for you.

SEE ALSO

Top

Catalyst::Manual, Catalyst::Helper, Catalyst::Model::Handel::Cart

AUTHOR

Top

    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::Cart;
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'} = "cart_class => '$app\:\:Cart',\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__