line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ODS::Table::Column::Base; |
2
|
|
|
|
|
|
|
|
3
|
72
|
|
|
72
|
|
30789
|
use YAOO; |
|
72
|
|
|
|
|
144
|
|
|
72
|
|
|
|
|
291
|
|
4
|
|
|
|
|
|
|
|
5
|
72
|
|
|
72
|
|
22603
|
use ODS::Utils qw/clone error/; |
|
72
|
|
|
|
|
197
|
|
|
72
|
|
|
|
|
307
|
|
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
|
39374
|
|
|
39374
|
0
|
458912
|
my ($self, $data, $already_inflated, $serialize) = @_; |
29
|
|
|
|
|
|
|
|
30
|
39374
|
|
|
|
|
75217
|
$self = clone($self); |
31
|
|
|
|
|
|
|
|
32
|
39374
|
100
|
66
|
|
|
169831
|
$self->serialize_class($serialize) if $serialize && $self->can('serialize_class'); |
33
|
|
|
|
|
|
|
|
34
|
39374
|
|
|
|
|
98634
|
$self->inflated($already_inflated); |
35
|
|
|
|
|
|
|
|
36
|
39374
|
|
|
|
|
1015539
|
$self->value($data); |
37
|
|
|
|
|
|
|
|
38
|
39374
|
|
|
|
|
1090476
|
$self->inflate($data); |
39
|
|
|
|
|
|
|
|
40
|
39374
|
|
|
|
|
365524
|
return $self; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub store_column { |
44
|
25816
|
|
|
25816
|
0
|
144458
|
my ($self) = @_; |
45
|
|
|
|
|
|
|
|
46
|
25816
|
|
|
|
|
37803
|
return $self->validate()->deflate(); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub validate { |
50
|
51581
|
|
|
51581
|
0
|
183649
|
my ($self) = @_; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
# has_validation_class |
53
|
51581
|
100
|
|
|
|
146738
|
return $self unless $self->can('validation'); |
54
|
|
|
|
|
|
|
|
55
|
44737
|
|
|
|
|
78523
|
$self->value( |
56
|
|
|
|
|
|
|
$self->validation($self->value) |
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
|
59
|
44737
|
|
|
|
|
1105681
|
return $self; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub inflate { |
63
|
39374
|
|
|
39374
|
0
|
53518
|
my ($self) = @_; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# has_validation_class |
66
|
39374
|
100
|
100
|
|
|
63857
|
return $self unless not $self->inflated and $self->can('inflation'); |
67
|
|
|
|
|
|
|
|
68
|
2735
|
|
|
|
|
27690
|
$self->value( |
69
|
|
|
|
|
|
|
$self->inflation($self->value) |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
2735
|
|
|
|
|
37251
|
$self->inflated(1); |
73
|
|
|
|
|
|
|
|
74
|
2735
|
|
|
|
|
73782
|
return $self; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub deflate { |
78
|
25816
|
|
|
25816
|
0
|
37969
|
my ($self) = @_; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
# has_validation_class |
81
|
25816
|
100
|
100
|
|
|
44722
|
return $self unless $self->inflated && $self->can('deflation'); |
82
|
|
|
|
|
|
|
|
83
|
5145
|
|
|
|
|
68096
|
$self->value( |
84
|
|
|
|
|
|
|
$self->deflation($self->value) |
85
|
|
|
|
|
|
|
); |
86
|
|
|
|
|
|
|
|
87
|
5145
|
|
|
|
|
121826
|
$self->inflated(0); |
88
|
|
|
|
|
|
|
|
89
|
5145
|
|
|
|
|
45171
|
return $self; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
__END__ |