Pics common module. Using Rose::Object generic methods generator instead of raw perl...
[blog.pm-common-perl-mods.git] / Common-RDBO-Helper / t / lib / Article.pm
blobc9036d9aed7399ba3209ae0b0aac1491b76c983c
1 package Article;
3 use strict;
5 use base qw(DB::Object);
7 use Rose::Object::MakeMethods::Generic ( scalar => [ qw/ pic / ] );
9 use Common::RDBO::Helper::Post qw(:all);
11 __PACKAGE__->meta->setup(
12 table => 'article',
14 columns => [
15 qw/ id title content /,
16 addtime => { type => 'epoch' }
19 primary_key_columns => [ qw/ id / ],
21 relationships => [
22 comments => {
23 type => 'one to many',
24 class => 'Comment',
25 column_map => { id => 'master_id' },
26 query_args => [ type => 'article' ]
28 pics => {
29 type => 'one to many',
30 class => 'Pic',
31 column_map => { id => 'master_id' },
32 query_args => [ type => 'article' ]
37 =head1 AUTHOR
39 vti
41 =head1 LICENSE
43 This library is free software, you can redistribute it and/or modify
44 it under the same terms as Perl itself.
46 =cut