line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: DAO request - retrieve by relationship |
2
|
|
|
|
|
|
|
package PONAPI::DAO::Request::RetrieveByRelationship; |
3
|
|
|
|
|
|
|
|
4
|
8
|
|
|
8
|
|
68
|
use Moose; |
|
8
|
|
|
|
|
51
|
|
|
8
|
|
|
|
|
110
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
extends 'PONAPI::DAO::Request'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with 'PONAPI::DAO::Request::Role::HasFields', |
9
|
|
|
|
|
|
|
'PONAPI::DAO::Request::Role::HasFilter', |
10
|
|
|
|
|
|
|
'PONAPI::DAO::Request::Role::HasInclude', |
11
|
|
|
|
|
|
|
'PONAPI::DAO::Request::Role::HasPage', |
12
|
|
|
|
|
|
|
'PONAPI::DAO::Request::Role::HasSort', |
13
|
|
|
|
|
|
|
'PONAPI::DAO::Request::Role::HasID', |
14
|
|
|
|
|
|
|
'PONAPI::DAO::Request::Role::HasRelationshipType'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub execute { |
17
|
15
|
|
|
15
|
0
|
27
|
my $self = shift; |
18
|
|
|
|
|
|
|
|
19
|
15
|
100
|
|
|
|
552
|
if ( $self->is_valid ) { |
20
|
10
|
|
|
|
|
350
|
my $repo = $self->repository; |
21
|
10
|
|
|
|
|
358
|
my $document = $self->document; |
22
|
10
|
|
|
|
|
329
|
my $one_to_many = $repo->has_one_to_many_relationship($self->type, $self->rel_type); |
23
|
|
|
|
|
|
|
|
24
|
10
|
100
|
|
|
|
50
|
$document->convert_to_collection if $one_to_many; |
25
|
|
|
|
|
|
|
|
26
|
10
|
|
|
|
|
17
|
$repo->retrieve_by_relationship( %{ $self } ); |
|
10
|
|
|
|
|
76
|
|
27
|
|
|
|
|
|
|
|
28
|
7
|
50
|
66
|
|
|
198
|
$document->add_null_resource |
29
|
|
|
|
|
|
|
unless $one_to_many or $document->has_resource_builders; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
12
|
|
|
|
|
79
|
return $self->response(); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
36
|
8
|
|
|
8
|
|
53767
|
no Moose; 1; |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
44
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=pod |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=encoding UTF-8 |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 NAME |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
PONAPI::DAO::Request::RetrieveByRelationship - DAO request - retrieve by relationship |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 VERSION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
version 0.002006 |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 AUTHORS |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=over 4 |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=item * |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Mickey Nasriachi <mickey@cpan.org> |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item * |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Stevan Little <stevan@cpan.org> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=item * |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Brian Fraser <hugmeir@cpan.org> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=back |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This software is copyright (c) 2016 by Mickey Nasriachi, Stevan Little, Brian Fraser. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
75
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |