line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: DAO request role - `include` |
2
|
|
|
|
|
|
|
package PONAPI::DAO::Request::Role::HasInclude; |
3
|
|
|
|
|
|
|
|
4
|
8
|
|
|
8
|
|
5295
|
use Moose::Role; |
|
8
|
|
|
|
|
20
|
|
|
8
|
|
|
|
|
53
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has include => ( |
7
|
|
|
|
|
|
|
traits => [ 'Array' ], |
8
|
|
|
|
|
|
|
is => 'ro', |
9
|
|
|
|
|
|
|
isa => 'ArrayRef', |
10
|
|
|
|
|
|
|
default => sub { +[] }, |
11
|
|
|
|
|
|
|
handles => { |
12
|
|
|
|
|
|
|
"has_include" => 'count', |
13
|
|
|
|
|
|
|
}, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _validate_include { |
17
|
20
|
|
|
20
|
|
1032
|
my $self = shift; |
18
|
20
|
|
|
|
|
794
|
my $type = $self->type; |
19
|
|
|
|
|
|
|
|
20
|
20
|
100
|
|
|
|
1295
|
return $self->_bad_request( "`include` is missing values" ) |
21
|
|
|
|
|
|
|
unless $self->has_include >= 1; |
22
|
|
|
|
|
|
|
|
23
|
19
|
|
|
|
|
43
|
for ( @{ $self->include } ) { |
|
19
|
|
|
|
|
877
|
|
24
|
24
|
100
|
|
|
|
974
|
$self->repository->has_relationship( $type, $_ ) |
25
|
|
|
|
|
|
|
or $self->_bad_request( "Types `$type` and `$_` are not related", 404 ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
8
|
|
|
8
|
|
42039
|
no Moose::Role; 1; |
|
8
|
|
|
|
|
23
|
|
|
8
|
|
|
|
|
43
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=pod |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=encoding UTF-8 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 NAME |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
PONAPI::DAO::Request::Role::HasInclude - DAO request role - `include` |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 VERSION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
version 0.002006 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 AUTHORS |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=over 4 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item * |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Mickey Nasriachi <mickey@cpan.org> |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=item * |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Stevan Little <stevan@cpan.org> |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=item * |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Brian Fraser <hugmeir@cpan.org> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=back |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This software is copyright (c) 2016 by Mickey Nasriachi, Stevan Little, Brian Fraser. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
68
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |