OOM/Link/Provider.pm

filter: Statementstmt 100% 6 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod 100% 1 / 1 totaltotal 88.8% 8 / 9 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
close_connections
1.0
CRAP 1.0
« OOM/Class.pm ↑ Summary OOM.pm »
1 package OpenERP::OOM::Link::Provider;
2  
3 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 requires 'provide_link';
6 2 with 'OpenERP::OOM::DynamicUtils';
7  
8 sub close_connections
9 0 ▶{
Subroutine close_connections: not called CC=1 SCAR=0.0
Pod documented
10 }
11  
12 =head1 NAME
13  
14 OpenERP::OOM::Link::Provider
15  
16 =head1 DESCRIPTION
17  
18 This is the role for a link provider that provides a way to link another dataset,
19 normally a DBIC dataset.
20  
21 =head1 SYNOPSIS
22  
23 package MyLinkProvider;
24  
25 use Moose;
26 with 'OpenERP::OOM::Link::Provider';
27  
28 sub provide_link
29 {
30 my ($self, $class) = @_;
31
32 my $package = ($class =~ /^\+/) ? $class : "OpenERP::OOM::Link::$class";
33  
34 eval "use $package";
35 $self->ensure_class_loaded($package);
36
37 return $package->new(
38 schema => $self,
39 config => $self->link_config->{$class},
40 );
41 }
42  
43 1;
44  
45 =head1 METHODS
46  
47 =head2 close_connections
48  
49 This method should close any open database connections held by the link provider.
50  
51 =head1 COPYRIGHT and LICENSE
52  
53 Copyright (C) 2011 OpusVL
54  
55 This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
56  
57 =cut
58  
59 2 1;
« OOM/Class.pm ↑ Summary OOM.pm »