initial checkin
[catagits/Catalyst-Model-DBIC-Schema.git] / lib / Catalyst / Helper / Model / DBIC / Schema.pm
CommitLineData
ad91060a 1package Catalyst::Helper::Model::DBIC::Schema;
2
3use strict;
4
5=head1 NAME
6
7Catalyst::Helper::Model::DBIC::Schema - Helper for DBIC Schema Models
8
9=head1 SYNOPSIS
10
11 script/create.pl model Foo DBIC::Schema Foo::SchemaClass dsn user password
12
13=head1 DESCRIPTION
14
15Helper for the DBIC Plain Models.
16
17=head2 METHODS
18
19=head3 mk_compclass
20
21=cut
22
23sub mk_compclass {
24 my ( $self, $helper, $schemaclass, $dsn, $user, $pass ) = @_;
25 $helper->{schemaclass} = $schemaclass || '';
26 $helper->{dsn} = $dsn || '';
27 $helper->{user} = $user || '';
28 $helper->{pass} = $pass || '';
29 my $file = $helper->{file};
30 $helper->render_file( 'compclass', $file );
31}
32
33=head1 SEE ALSO
34
35L<Catalyst::Manual>, L<Catalyst::Test>, L<Catalyst::Request>,
36L<Catalyst::Response>, L<Catalyst::Helper>
37
38=head1 AUTHOR
39
40Brandon L Black, C<blblack@gmail.com>
41
42=head1 LICENSE
43
44This library is free software, you can redistribute it and/or modify
45it under the same terms as Perl itself.
46
47=cut
48
49__DATA__
50
51__compclass__
52package [% class %];
53
54use strict;
55use base 'Catalyst::Model::DBIC::Schema';
56
57__PACKAGE__->config(
58 schema_class => '[% schemaclass %]
59 connect_info => [ '[% dsn %]',
60 '[% user %]',
61 '[% pass %]',
62 {
63 RaiseError => 1,
64 PrintError => 0,
65 ShowErrorStatement => 1,
66 TraceLevel => 0,
67 AutoCommit => 1,
68 }
69 ],
70);
71
72=head1 NAME
73
74[% class %] - Catalyst DBIC Plain Model
75
76=head1 SYNOPSIS
77
78See L<[% app %]>
79
80=head1 DESCRIPTION
81
82Catalyst::Model::DBIC::Schema Model
83
84=head1 AUTHOR
85
86[% author %]
87
88=head1 LICENSE
89
90This library is free software, you can redistribute it and/or modify
91it under the same terms as Perl itself.
92
93=cut
94
951;