line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ObjectDB::Factory; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
86
|
use strict; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
167
|
|
4
|
5
|
|
|
5
|
|
27
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
258
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '3.28'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Carp; |
9
|
5
|
|
|
5
|
|
1993
|
use ObjectDB::Util qw(load_class); |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
1014
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
5
|
|
|
5
|
0
|
8
|
my $class = shift; |
13
|
|
|
|
|
|
|
|
14
|
5
|
|
|
|
|
10
|
my $self = {}; |
15
|
5
|
|
|
|
|
11
|
bless $self, $class; |
16
|
|
|
|
|
|
|
|
17
|
5
|
|
|
|
|
13
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
0
|
0
|
0
|
sub namespace { Carp::croak('implement') } |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub build { |
23
|
5
|
|
|
5
|
0
|
8
|
my $self = shift; |
24
|
5
|
|
|
|
|
9
|
my $type = shift; |
25
|
5
|
|
|
|
|
15
|
my %params = @_; |
26
|
|
|
|
|
|
|
|
27
|
5
|
50
|
|
|
|
12
|
Carp::croak('type is required') unless $type; |
28
|
|
|
|
|
|
|
|
29
|
5
|
|
|
|
|
17
|
my @parts = map { ucfirst } split q{ }, $type; |
|
15
|
|
|
|
|
35
|
|
30
|
5
|
|
|
|
|
17
|
my $rel_class = $self->namespace . join q{}, @parts; |
31
|
|
|
|
|
|
|
|
32
|
5
|
|
|
|
|
18
|
load_class $rel_class; |
33
|
|
|
|
|
|
|
|
34
|
5
|
|
|
|
|
37
|
return $rel_class->new(%params); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |