line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Readonly Directive for Validation Class Field Definitions |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Validation::Class::Directive::Readonly; |
4
|
|
|
|
|
|
|
|
5
|
108
|
|
|
108
|
|
69037
|
use strict; |
|
108
|
|
|
|
|
220
|
|
|
108
|
|
|
|
|
2856
|
|
6
|
108
|
|
|
108
|
|
553
|
use warnings; |
|
108
|
|
|
|
|
215
|
|
|
108
|
|
|
|
|
2998
|
|
7
|
|
|
|
|
|
|
|
8
|
108
|
|
|
108
|
|
530
|
use base 'Validation::Class::Directive'; |
|
108
|
|
|
|
|
188
|
|
|
108
|
|
|
|
|
7726
|
|
9
|
|
|
|
|
|
|
|
10
|
108
|
|
|
108
|
|
615
|
use Validation::Class::Util; |
|
108
|
|
|
|
|
212
|
|
|
108
|
|
|
|
|
700
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '7.900057'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'mixin' => 0; |
16
|
|
|
|
|
|
|
has 'field' => 1; |
17
|
|
|
|
|
|
|
has 'multi' => 0; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub normalize { |
20
|
|
|
|
|
|
|
|
21
|
1002
|
|
|
1002
|
0
|
1790
|
my ($self, $proto, $field) = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# respect readonly fields |
24
|
|
|
|
|
|
|
|
25
|
1002
|
50
|
|
|
|
2867
|
if (defined $field->{readonly}) { |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
0
|
my $name = $field->name; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# probably shouldn't be deleting the submitted parameters !!! |
30
|
0
|
0
|
|
|
|
0
|
delete $proto->params->{$name} if exists $proto->params->{$name}; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
1002
|
|
|
|
|
2745
|
return $self; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |