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
|
|
54496
|
use strict; |
|
109
|
|
|
|
|
314
|
|
|
109
|
|
|
|
|
3199
|
|
6
|
109
|
|
|
109
|
|
634
|
use warnings; |
|
109
|
|
|
|
|
256
|
|
|
109
|
|
|
|
|
2839
|
|
7
|
|
|
|
|
|
|
|
8
|
109
|
|
|
109
|
|
596
|
use base 'Validation::Class::Directive'; |
|
109
|
|
|
|
|
283
|
|
|
109
|
|
|
|
|
10076
|
|
9
|
|
|
|
|
|
|
|
10
|
109
|
|
|
109
|
|
792
|
use Validation::Class::Util; |
|
109
|
|
|
|
|
247
|
|
|
109
|
|
|
|
|
737
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '7.900059'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'mixin' => 0; |
16
|
|
|
|
|
|
|
has 'field' => 1; |
17
|
|
|
|
|
|
|
has 'multi' => 0; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub normalize { |
20
|
|
|
|
|
|
|
|
21
|
1009
|
|
|
1009
|
0
|
4222
|
my ($self, $proto, $field) = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# respect readonly fields |
24
|
|
|
|
|
|
|
|
25
|
1009
|
50
|
|
|
|
2916
|
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
|
|
|
|
|
2528
|
return $self; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |