line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Moose::Role; |
3
|
1
|
|
|
1
|
|
911
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
4
|
|
|
|
|
|
|
requires 'provide_link'; |
5
|
|
|
|
|
|
|
with 'OpenERP::OOM::DynamicUtils'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
{ |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
0
|
1
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
OpenERP::OOM::Link::Provider |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 DESCRIPTION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
This is the role for a link provider that provides a way to link another dataset, |
17
|
|
|
|
|
|
|
normally a DBIC dataset. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
package MyLinkProvider; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use Moose; |
24
|
|
|
|
|
|
|
with 'OpenERP::OOM::Link::Provider'; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub provide_link |
27
|
|
|
|
|
|
|
{ |
28
|
|
|
|
|
|
|
my ($self, $class) = @_; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
my $package = ($class =~ /^\+/) ? $class : "OpenERP::OOM::Link::$class"; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
eval "use $package"; |
33
|
|
|
|
|
|
|
$self->ensure_class_loaded($package); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
return $package->new( |
36
|
|
|
|
|
|
|
schema => $self, |
37
|
|
|
|
|
|
|
config => $self->link_config->{$class}, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 METHODS |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 close_connections |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
This method should close any open database connections held by the link provider. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 COPYRIGHT and LICENSE |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Copyright (C) 2011 OpusVL |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |