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
|
109
|
|
|
109
|
|
43674
|
use strict; |
|
109
|
|
|
|
|
237
|
|
|
109
|
|
|
|
|
2670
|
|
6
|
109
|
|
|
109
|
|
504
|
use warnings; |
|
109
|
|
|
|
|
199
|
|
|
109
|
|
|
|
|
2399
|
|
7
|
|
|
|
|
|
|
|
8
|
109
|
|
|
109
|
|
483
|
use base 'Validation::Class::Directive'; |
|
109
|
|
|
|
|
225
|
|
|
109
|
|
|
|
|
8198
|
|
9
|
|
|
|
|
|
|
|
10
|
109
|
|
|
109
|
|
638
|
use Validation::Class::Util; |
|
109
|
|
|
|
|
321
|
|
|
109
|
|
|
|
|
603
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '7.900058'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'mixin' => 0; |
16
|
|
|
|
|
|
|
has 'field' => 1; |
17
|
|
|
|
|
|
|
has 'multi' => 0; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub normalize { |
20
|
|
|
|
|
|
|
|
21
|
1009
|
|
|
1009
|
0
|
2070
|
my ($self, $proto, $field) = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# respect readonly fields |
24
|
|
|
|
|
|
|
|
25
|
1009
|
50
|
|
|
|
2436
|
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
|
1009
|
|
|
|
|
2066
|
return $self; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |