minor fixups
[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
dce0dfe8 491;
50
ad91060a 51__DATA__
52
53__compclass__
54package [% class %];
55
56use strict;
57use base 'Catalyst::Model::DBIC::Schema';
58
59__PACKAGE__->config(
dce0dfe8 60 schema_class => '[% schemaclass %]',
ad91060a 61 connect_info => [ '[% dsn %]',
62 '[% user %]',
63 '[% pass %]',
64 {
65 RaiseError => 1,
66 PrintError => 0,
67 ShowErrorStatement => 1,
68 TraceLevel => 0,
69 AutoCommit => 1,
70 }
71 ],
72);
73
74=head1 NAME
75
76[% class %] - Catalyst DBIC Plain Model
77
78=head1 SYNOPSIS
79
80See L<[% app %]>
81
82=head1 DESCRIPTION
83
84Catalyst::Model::DBIC::Schema Model
85
86=head1 AUTHOR
87
88[% author %]
89
90=head1 LICENSE
91
92This library is free software, you can redistribute it and/or modify
93it under the same terms as Perl itself.
94
95=cut
96
971;