comparison lib/Benzin/Bugzilla/BugComment.pm @ 9:cc7244ab1b9f

implemented time reports on bugs
author cin
date Sat, 05 Sep 2015 22:01:12 +0300
parents ff9c0c788382
children
comparison
equal deleted inserted replaced
8:ff9c0c788382 9:cc7244ab1b9f
2 use strict; 2 use strict;
3 3
4 my @fields; 4 my @fields;
5 5
6 BEGIN { 6 BEGIN {
7 @fields = qw( 7 @fields = qw(
8 id 8 id
9 bug_id 9 bug_id
10 attachment_id 10 attachment_id
11 count 11 count
12 text 12 text
13 creator 13 creator
14 creation_time 14 creation_time
15 is_private 15 is_private
16 is_markdown 16 is_markdown
17 ); 17 );
18 } 18 }
19 19
20 use constant { 20 use constant { COMMENT_FIELDS => \@fields };
21 BUG_FIELDS => \@fields
22 };
23 21
24 use IMPL::declare { 22 use IMPL::declare {
25 base => [ 23 base => [
26 'IMPL::Object::Fields' => undef 24 'IMPL::Object::Fields' => undef
27 ] 25 ]
28 }; 26 };
29 27
30 use fields @fields; 28 use fields @fields;
31 29
32 sub CTOR { 30 sub CTOR {
33 my SELF $this = shift; 31 my SELF $this = shift;
34 my $data = shift; 32 my $data = shift;
35 33
36 $this->{$_} = $data->{$_} foreach grep exists $data->{$_}, SELF->BUG_FIELDS; 34 $this->{$_} = $data->{$_}
35 foreach grep exists $data->{$_}, @{ SELF->COMMENT_FIELDS };
37 } 36 }
38 37
39
40 1; 38 1;