line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Processor::Model; |
2
|
|
|
|
|
|
|
$Form::Processor::Model::VERSION = '1.162360'; |
3
|
5
|
|
|
5
|
|
1875
|
use strict; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
107
|
|
4
|
5
|
|
|
5
|
|
14
|
use warnings; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
89
|
|
5
|
5
|
|
|
5
|
|
13
|
use base 'Rose::Object'; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
267
|
|
6
|
5
|
|
|
5
|
|
19
|
use Carp; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
304
|
|
7
|
5
|
|
|
5
|
|
2589
|
use Data::Dumper; |
|
5
|
|
|
|
|
31015
|
|
|
5
|
|
|
|
|
246
|
|
8
|
5
|
|
|
5
|
|
25
|
use Scalar::Util qw/ blessed /; |
|
5
|
|
|
|
|
4
|
|
|
5
|
|
|
|
|
342
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Define instance data |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use Rose::Object::MakeMethods::Generic ( |
14
|
|
|
|
|
|
|
|
15
|
5
|
|
|
|
|
47
|
scalar => [ |
16
|
|
|
|
|
|
|
object_class => { interface => 'get_set_init' }, |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
#item_id => {}, # Can't init from item->id because of circular references |
19
|
|
|
|
|
|
|
item => { interface => 'get_set_init' }, |
20
|
|
|
|
|
|
|
], |
21
|
5
|
|
|
5
|
|
1876
|
); |
|
5
|
|
|
|
|
22992
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# ABSTRACT: default model base class |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub init_object_class { |
28
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
29
|
0
|
|
|
|
|
0
|
my $item = $self->item; |
30
|
0
|
|
|
|
|
0
|
return ref $item; # may be undefined |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
5
|
|
|
5
|
1
|
51
|
sub init_item {return} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
0
|
1
|
0
|
sub guess_field_type { Carp::confess "Don't know how to determine field type of [$_[1]]" } |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
5
|
|
|
5
|
1
|
7
|
sub lookup_options {return} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub init_value { |
50
|
0
|
|
|
0
|
1
|
|
my ( $self, $field, $item ) = @_; |
51
|
0
|
|
|
|
|
|
my $name = $field->name; |
52
|
|
|
|
|
|
|
|
53
|
0
|
0
|
|
|
|
|
return $item->can( $name ) ? $item->$name : undef |
|
|
0
|
|
|
|
|
|
54
|
|
|
|
|
|
|
if blessed( $item ); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
return $item->{$name}; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub update_from_form { |
63
|
0
|
|
|
0
|
1
|
|
die "must define 'update_from_form' in Form::Processor::Model subclass"; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
3
|
1
|
|
sub model_validate { } |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |