line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::DB::Connector::Role::ResultsRoles; |
2
|
1
|
|
|
1
|
|
773
|
use Mojo::Base -role; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
15
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
requires 'new_connection'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has results_roles => sub { [] }; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
around new_connection => sub { |
9
|
|
|
|
|
|
|
my $orig = shift; |
10
|
|
|
|
|
|
|
my $self = shift; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
return $self->$orig(@_) |
13
|
|
|
|
|
|
|
unless my @roles = @{ $self->results_roles }; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $connection = $self->$orig(@_); |
16
|
|
|
|
|
|
|
$connection->with_roles('Mojo::DB::Role::ResultsRoles'); |
17
|
|
|
|
|
|
|
push @{$connection->results_roles}, @roles; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
return $connection; |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |
23
|
|
|
|
|
|
|
__END__ |