| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package MojoMojo::Schema::Result::Comment; |
|
2
|
|
|
|
|
|
|
|
|
3
|
40
|
|
|
40
|
|
24993
|
use strict; |
|
|
40
|
|
|
|
|
100
|
|
|
|
40
|
|
|
|
|
1082
|
|
|
4
|
40
|
|
|
40
|
|
192
|
use warnings; |
|
|
40
|
|
|
|
|
84
|
|
|
|
40
|
|
|
|
|
1078
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
40
|
|
|
40
|
|
205
|
use parent qw/MojoMojo::Schema::Base::Result/; |
|
|
40
|
|
|
|
|
90
|
|
|
|
40
|
|
|
|
|
369
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
40
|
|
|
40
|
|
16024
|
use Text::Textile; |
|
|
40
|
|
|
|
|
461918
|
|
|
|
40
|
|
|
|
|
7418
|
|
|
9
|
|
|
|
|
|
|
my $textile = Text::Textile->new( |
|
10
|
|
|
|
|
|
|
disable_html => 1, |
|
11
|
|
|
|
|
|
|
flavor => 'xhtml2', |
|
12
|
|
|
|
|
|
|
charset => 'utf8', |
|
13
|
|
|
|
|
|
|
char_encoding => 1 |
|
14
|
|
|
|
|
|
|
); |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
__PACKAGE__->load_components( |
|
17
|
|
|
|
|
|
|
qw/DateTime::Epoch TimeStamp Core/); |
|
18
|
|
|
|
|
|
|
__PACKAGE__->table("comment"); |
|
19
|
|
|
|
|
|
|
__PACKAGE__->add_columns( |
|
20
|
|
|
|
|
|
|
"id", |
|
21
|
|
|
|
|
|
|
{ |
|
22
|
|
|
|
|
|
|
data_type => "INTEGER", |
|
23
|
|
|
|
|
|
|
is_nullable => 0, |
|
24
|
|
|
|
|
|
|
size => undef, |
|
25
|
|
|
|
|
|
|
is_auto_increment => 1 |
|
26
|
|
|
|
|
|
|
}, |
|
27
|
|
|
|
|
|
|
"poster", |
|
28
|
|
|
|
|
|
|
{ data_type => "INTEGER", is_nullable => 0, size => undef }, |
|
29
|
|
|
|
|
|
|
"page", |
|
30
|
|
|
|
|
|
|
{ data_type => "INTEGER", is_nullable => 0, size => undef }, |
|
31
|
|
|
|
|
|
|
"picture", |
|
32
|
|
|
|
|
|
|
{ data_type => "INTEGER", is_nullable => 1, size => undef }, |
|
33
|
|
|
|
|
|
|
"posted", |
|
34
|
|
|
|
|
|
|
{ |
|
35
|
|
|
|
|
|
|
data_type => "BIGINT", |
|
36
|
|
|
|
|
|
|
is_nullable => 0, |
|
37
|
|
|
|
|
|
|
size => undef, |
|
38
|
|
|
|
|
|
|
inflate_datetime => 'epoch', |
|
39
|
|
|
|
|
|
|
set_on_create => 1, |
|
40
|
|
|
|
|
|
|
}, |
|
41
|
|
|
|
|
|
|
"body", |
|
42
|
|
|
|
|
|
|
{ data_type => "TEXT", is_nullable => 0, size => undef }, |
|
43
|
|
|
|
|
|
|
); |
|
44
|
|
|
|
|
|
|
__PACKAGE__->set_primary_key("id"); |
|
45
|
|
|
|
|
|
|
__PACKAGE__->belongs_to( |
|
46
|
|
|
|
|
|
|
"poster", |
|
47
|
|
|
|
|
|
|
"MojoMojo::Schema::Result::Person", |
|
48
|
|
|
|
|
|
|
{ id => "poster" } |
|
49
|
|
|
|
|
|
|
); |
|
50
|
|
|
|
|
|
|
__PACKAGE__->belongs_to( |
|
51
|
|
|
|
|
|
|
"page", |
|
52
|
|
|
|
|
|
|
"MojoMojo::Schema::Result::Page", |
|
53
|
|
|
|
|
|
|
{ id => "page" } |
|
54
|
|
|
|
|
|
|
); |
|
55
|
|
|
|
|
|
|
__PACKAGE__->belongs_to( |
|
56
|
|
|
|
|
|
|
"picture", |
|
57
|
|
|
|
|
|
|
"MojoMojo::Schema::Result::Photo", |
|
58
|
|
|
|
|
|
|
{ id => "picture" } |
|
59
|
|
|
|
|
|
|
); |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 NAME |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
MojoMojo::Schema::Result::Comment - store comments |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 METHODS |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 formatted |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Returns a Textile formatted version of the given comment. |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
TODO: the default formatter may not be Textile. |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub formatted { |
|
76
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
77
|
0
|
|
|
|
|
|
return $textile->process( $self->body ); |
|
78
|
|
|
|
|
|
|
} |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 AUTHOR |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Marcus Ramberg <mramberg@cpan.org> |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 LICENSE |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
This library is free software. You can redistribute it and/or modify |
|
87
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
1; |