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