All common helpers in one place.
[blog.pm-common-perl-mods.git] / Common-RDBO-Helper / t / lib / Tag.pm
blob90fd8fbeef6e38e759e2f9f29be74e7a0005e32c
1 package Tag;
3 use strict;
5 use base qw(DB::Object);
7 use Rose::Object::MakeMethods::Generic (
8 scalar => [ qw/ count / ] );
10 use Common::RDBO::Helpers ':all';
12 __PACKAGE__->meta->setup(
13 table => 'tag',
15 columns => [ qw/ id name / ],
17 primary_key_columns => [ 'id' ],
19 unique_key => 'name',
21 relationships => [
22 post_tag_map => {
23 type => 'one to many',
24 class => 'PostTagMap',
25 column_map => { id => 'tag_id' }
27 posts => {
28 type => 'many to many',
29 map_class => 'PostTagMap',
30 map_from => 'tag',
31 map_to => 'post'
36 =head1 AUTHOR
38 vti
40 =head1 LICENSE
42 This library is free software, you can redistribute it and/or modify
43 it under the same terms as Perl itself.
45 =cut