line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::Model::Adaptor::Base; |
2
|
1
|
|
|
1
|
|
92598
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
56
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
129
|
|
6
|
1
|
|
|
1
|
|
140749
|
use MRO::Compat; |
|
1
|
|
|
|
|
9297
|
|
|
1
|
|
|
|
|
37
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
30
|
use base 'Catalyst::Model'; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
3518
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub _load_adapted_class { |
11
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
12
|
|
|
|
|
|
|
|
13
|
0
|
0
|
|
|
|
|
croak 'need class' unless $self->{class}; |
14
|
0
|
|
|
|
|
|
my $adapted_class = $self->{class}; |
15
|
0
|
|
|
|
|
|
Catalyst::Utils::ensure_class_loaded($adapted_class); |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
return $adapted_class; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _create_instance { |
21
|
0
|
|
|
0
|
|
|
my ($self, $app, $rest) = @_; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
0
|
|
|
|
my $constructor = $self->{constructor} || 'new'; |
24
|
0
|
|
|
|
|
|
my $arg = $self->prepare_arguments($app, $rest); |
25
|
0
|
|
|
|
|
|
my $adapted_class = $self->{class}; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
return $adapted_class->$constructor($self->mangle_arguments($arg)); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub prepare_arguments { |
31
|
0
|
|
|
0
|
1
|
|
my ($self, $app, $arg) = @_; |
32
|
0
|
|
|
|
|
|
return exists $self->{args} ? { |
33
|
0
|
0
|
|
|
|
|
%{$self->{args}}, |
34
|
|
|
|
|
|
|
%$arg, |
35
|
|
|
|
|
|
|
} : $arg; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub mangle_arguments { |
39
|
0
|
|
|
0
|
1
|
|
my ($self, $args) = @_; |
40
|
0
|
|
|
|
|
|
return $args; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 NAME |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Catalyst::Model::Adaptor::Base - internal base class for Catalyst::Model::Adaptor and friends. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SYNOPSIS |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# There are no user-serviceable parts in here. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 METHODS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 _load_adapted_class |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Load the adapted class |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 _create_instance |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Instantiate the adapted class |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 prepare_arguments |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Prepare the arguements |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 mangle_arguments |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Make the arguements amenable to the adapted class |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SEE ALSO |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
L<Catalyst::Model::Adaptor> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
L<Catalyst::Model::Factory> |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
L<Catalyst::Model::Factory::PerRequest> |
80
|
|
|
|
|
|
|
|