line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ODS::Table::Column::Base; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
720
|
use YAOO; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
8
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
514
|
use ODS::Utils qw/clone error/; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
9
|
|
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
|
60
|
|
|
60
|
0
|
792
|
my ($self, $data, $already_inflated) = @_; |
29
|
|
|
|
|
|
|
|
30
|
60
|
|
|
|
|
118
|
$self = clone($self); |
31
|
|
|
|
|
|
|
|
32
|
60
|
|
|
|
|
168
|
$self->inflated($already_inflated); |
33
|
|
|
|
|
|
|
|
34
|
60
|
|
|
|
|
974
|
$self->value($data); |
35
|
|
|
|
|
|
|
|
36
|
60
|
|
|
|
|
1818
|
$self->inflate($data); |
37
|
|
|
|
|
|
|
|
38
|
60
|
|
|
|
|
660
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub store_column { |
42
|
132
|
|
|
132
|
0
|
653
|
my ($self) = @_; |
43
|
|
|
|
|
|
|
|
44
|
132
|
|
|
|
|
177
|
return $self->validate()->deflate(); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub validate { |
48
|
154
|
|
|
154
|
0
|
451
|
my ($self) = @_; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# has_validation_class |
51
|
154
|
50
|
|
|
|
354
|
return $self unless $self->can('validation'); |
52
|
|
|
|
|
|
|
|
53
|
154
|
|
|
|
|
259
|
$self->value( |
54
|
|
|
|
|
|
|
$self->validation($self->value) |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
|
57
|
154
|
|
|
|
|
3614
|
return $self; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub inflate { |
61
|
60
|
|
|
60
|
0
|
84
|
my ($self) = @_; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# has_validation_class |
64
|
60
|
100
|
100
|
|
|
94
|
return $self unless not $self->inflated and $self->can('inflation'); |
65
|
|
|
|
|
|
|
|
66
|
6
|
|
|
|
|
95
|
$self->value( |
67
|
|
|
|
|
|
|
$self->inflation($self->value) |
68
|
|
|
|
|
|
|
); |
69
|
|
|
|
|
|
|
|
70
|
6
|
|
|
|
|
137
|
$self->inflated(1); |
71
|
|
|
|
|
|
|
|
72
|
6
|
|
|
|
|
212
|
return $self; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub deflate { |
76
|
132
|
|
|
132
|
0
|
177
|
my ($self) = @_; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# has_validation_class |
79
|
132
|
50
|
66
|
|
|
184
|
return $self unless $self->inflated && $self->can('deflation'); |
80
|
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
$self->value( |
82
|
|
|
|
|
|
|
$self->deflation($self->value) |
83
|
|
|
|
|
|
|
); |
84
|
|
|
|
|
|
|
|
85
|
0
|
|
|
|
|
|
$self->inflated(0); |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
|
return $self; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub coerce { |
91
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
92
|
|
|
|
|
|
|
|
93
|
0
|
0
|
|
|
|
|
return unless $self->can('coercion'); |
94
|
|
|
|
|
|
|
|
95
|
0
|
|
|
|
|
|
$self->value( |
96
|
|
|
|
|
|
|
$self->coercion($self->value) |
97
|
|
|
|
|
|
|
); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
1; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
__END__ |