Filename | /home/mickey/git_tree/PONAPI/Server/lib/PONAPI/DAO/Request/Role/HasRelationshipType.pm |
Statements | Executed 6 statements in 187µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 18µs | 2.14ms | BEGIN@4 | PONAPI::DAO::Request::Role::HasRelationshipType::
1 | 1 | 1 | 8µs | 86µs | BEGIN@26 | PONAPI::DAO::Request::Role::HasRelationshipType::
0 | 0 | 0 | 0s | 0s | _validate_rel_type | PONAPI::DAO::Request::Role::HasRelationshipType::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # ABSTRACT: DAO request role - `relationship type` | ||||
2 | package PONAPI::DAO::Request::Role::HasRelationshipType; | ||||
3 | |||||
4 | 2 | 132µs | 2 | 4.27ms | # spent 2.14ms (18µs+2.13) within PONAPI::DAO::Request::Role::HasRelationshipType::BEGIN@4 which was called:
# once (18µs+2.13ms) by Module::Runtime::require_module at line 4 # spent 2.14ms making 1 call to PONAPI::DAO::Request::Role::HasRelationshipType::BEGIN@4
# spent 2.13ms making 1 call to Moose::Role::import |
5 | |||||
6 | 1 | 1µs | 1 | 136µs | has rel_type => ( # spent 136µs making 1 call to Moose::Role::has |
7 | is => 'ro', | ||||
8 | isa => 'Str', | ||||
9 | predicate => 'has_rel_type', | ||||
10 | ); | ||||
11 | |||||
12 | sub _validate_rel_type { | ||||
13 | my ( $self, $args ) = @_; | ||||
14 | |||||
15 | return $self->_bad_request( "`relationship type` is missing for this request" ) | ||||
16 | unless $self->has_rel_type; | ||||
17 | |||||
18 | my $type = $self->type; | ||||
19 | my $rel_type = $self->rel_type; | ||||
20 | |||||
21 | if ( !$self->repository->has_relationship( $type, $rel_type ) ) { | ||||
22 | return $self->_bad_request( "Types `$type` and `$rel_type` are not related", 404 ) | ||||
23 | } | ||||
24 | } | ||||
25 | |||||
26 | 3 | 54µs | 2 | 164µs | # spent 86µs (8+78) within PONAPI::DAO::Request::Role::HasRelationshipType::BEGIN@26 which was called:
# once (8µs+78µs) by Module::Runtime::require_module at line 26 # spent 86µs making 1 call to PONAPI::DAO::Request::Role::HasRelationshipType::BEGIN@26
# spent 78µs making 1 call to Moose::Role::unimport |
27 | |||||
28 | __END__ |