1 package Blog
::RDBO
::Post
;
5 use base
qw(Blog::DB::Object::I18N::Static);
7 use Rose
::Object
::MakeMethods
::Generic
( scalar => [ 'comment_count' ] );
9 __PACKAGE__
->meta->setup(
13 qw
/ id key orig_lang /,
14 addtime
=> { type
=> 'epoch', default => 'now' },
15 modtime
=> { type
=> 'epoch', default => 'now'}
18 primary_key_columns
=> [ qw
/ id / ],
20 unique_key
=> [ qw
/ key / ],
24 type
=> 'one to many',
25 class => 'Blog::RDBO::PostI18N',
26 column_map
=> { id
=> 'post_id' }
29 type
=> 'many to many',
30 map_class
=> 'Blog::RDBO::PostTagMap',
35 type
=> 'one to many',
36 class => 'Blog::RDBO::PostTagMap',
39 type
=> 'one to many',
40 class => 'Blog::RDBO::Comment',
41 column_map
=> { id
=> 'post_id' }
46 __PACKAGE__
->utf8_columns( qw
/ key / );
48 __PACKAGE__
->meta->column( 'modtime' )->add_trigger(
52 my $value = $self->modtime;
54 $self->modtime( time );
65 This library is free software, you can redistribute it and/or modify
66 it under the same terms as Perl itself.