line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ODS::Table::Column::Base; |
2
|
|
|
|
|
|
|
|
3
|
72
|
|
|
72
|
|
26773
|
use YAOO; |
|
72
|
|
|
|
|
148
|
|
|
72
|
|
|
|
|
295
|
|
4
|
|
|
|
|
|
|
|
5
|
72
|
|
|
72
|
|
22337
|
use ODS::Utils qw/clone error/; |
|
72
|
|
|
|
|
84
|
|
|
72
|
|
|
|
|
298
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
auto_build; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has name => rw, isa(string); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has type => rw, isa(string); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has value => rw, isa(any); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has mandatory => rw, isa(boolean); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has no_render => rw, isa(boolean); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has sortable => rw, isa(any); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has filterable => rw, isa(any); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has field => rw, isa(hash); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has inflated => rw, isa(boolean); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub build_column { |
28
|
39423
|
|
|
39423
|
0
|
470482
|
my ($self, $data, $already_inflated, $serialize) = @_; |
29
|
|
|
|
|
|
|
|
30
|
39423
|
|
|
|
|
67694
|
$self = clone($self); |
31
|
|
|
|
|
|
|
|
32
|
39423
|
100
|
66
|
|
|
173629
|
$self->serialize_class($serialize) if $serialize && $self->can('serialize_class'); |
33
|
|
|
|
|
|
|
|
34
|
39423
|
|
|
|
|
100016
|
$self->inflated($already_inflated); |
35
|
|
|
|
|
|
|
|
36
|
39423
|
|
|
|
|
1062510
|
$self->value($data); |
37
|
|
|
|
|
|
|
|
38
|
39423
|
|
|
|
|
1073116
|
$self->inflate($data); |
39
|
|
|
|
|
|
|
|
40
|
39423
|
|
|
|
|
686649
|
return $self; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub store_column { |
44
|
25872
|
|
|
25872
|
0
|
138702
|
my ($self) = @_; |
45
|
|
|
|
|
|
|
|
46
|
25872
|
|
|
|
|
34932
|
return $self->validate()->deflate(); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub validate { |
50
|
51658
|
|
|
51658
|
0
|
188246
|
my ($self) = @_; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
# has_validation_class |
53
|
51658
|
100
|
100
|
|
|
86278
|
return $self unless defined $self->value and $self->can('validation'); |
54
|
|
|
|
|
|
|
|
55
|
44686
|
|
|
|
|
539750
|
$self->value( |
56
|
|
|
|
|
|
|
$self->validation($self->value) |
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
|
59
|
44686
|
|
|
|
|
1101358
|
return $self; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub inflate { |
63
|
39423
|
|
|
39423
|
0
|
52826
|
my ($self) = @_; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# has_validation_class |
66
|
39423
|
100
|
100
|
|
|
58187
|
return $self unless defined $self->value and not $self->inflated and $self->can('inflation'); |
|
|
|
100
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
2726
|
|
|
|
|
49664
|
$self->value( |
69
|
|
|
|
|
|
|
$self->inflation($self->value) |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
2726
|
|
|
|
|
40526
|
$self->inflated(1); |
73
|
|
|
|
|
|
|
|
74
|
2726
|
|
|
|
|
73014
|
return $self; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub deflate { |
78
|
25872
|
|
|
25872
|
0
|
73972
|
my ($self) = @_; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
# has_validation_class |
81
|
25872
|
100
|
100
|
|
|
42438
|
return $self unless defined $self->value and $self->inflated and $self->can('deflation'); |
|
|
|
100
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
5153
|
|
|
|
|
115545
|
$self->value( |
84
|
|
|
|
|
|
|
$self->deflation($self->value) |
85
|
|
|
|
|
|
|
); |
86
|
|
|
|
|
|
|
|
87
|
5153
|
|
|
|
|
128686
|
$self->inflated(0); |
88
|
|
|
|
|
|
|
|
89
|
5153
|
|
|
|
|
44782
|
return $self; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
__END__ |