7
|
1 package Benzin::Bugzilla::BugComment;
|
|
2 use strict;
|
|
3
|
|
4 my @fields;
|
|
5
|
|
6 BEGIN {
|
9
|
7 @fields = qw(
|
|
8 id
|
|
9 bug_id
|
|
10 attachment_id
|
|
11 count
|
|
12 text
|
|
13 creator
|
|
14 creation_time
|
|
15 is_private
|
|
16 is_markdown
|
|
17 );
|
7
|
18 }
|
|
19
|
9
|
20 use constant { COMMENT_FIELDS => \@fields };
|
7
|
21
|
|
22 use IMPL::declare {
|
9
|
23 base => [
|
|
24 'IMPL::Object::Fields' => undef
|
|
25 ]
|
7
|
26 };
|
|
27
|
|
28 use fields @fields;
|
|
29
|
|
30 sub CTOR {
|
9
|
31 my SELF $this = shift;
|
|
32 my $data = shift;
|
|
33
|
|
34 $this->{$_} = $data->{$_}
|
|
35 foreach grep exists $data->{$_}, @{ SELF->COMMENT_FIELDS };
|
7
|
36 }
|
|
37
|
|
38 1;
|