| 1 | # ABSTRACT: DAO request role - `filter` | ||||||||||
| 2 | package PONAPI::DAO::Request::Role::HasFilter; | ||||||||||
| 3 | |||||||||||
| 4 | 8 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | has filter => ( | ||||||||||
| 7 | traits => [ 'Hash' ], | ||||||||||
| 8 | is => 'ro', | ||||||||||
| 9 | isa => 'HashRef', | ||||||||||
| 10 | 115 | ▶ | default => sub { +{} }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 8 | handles => { | |||||||||
| 12 | "has_filter" => 'count', | ||||||||||
| 13 | }, | ||||||||||
| 14 | ); | ||||||||||
| 15 | |||||||||||
| 16 | sub _validate_filter { | ||||||||||
| 17 | 112 | ▶ | my ( $self, $args ) = @_; | ||||||||
|
Subroutine
_validate_filter: called CC=3 SCAR=11.0
| |||||||||||
| 18 | |||||||||||
| 19 | 112 | ▶ | return unless defined $args->{filter}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | |||||||||||
| 21 | 3 | ▶ | $self->has_filter | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | or $self->_bad_request( "`filter` is missing values" ); | ||||||||||
| 23 | |||||||||||
| 24 | 3 | return; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 8 | ▶ | no Moose::Role; 1; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 28 | |||||||||||
| 29 | __END__ | ||||||||||
| 30 | |||||||||||
| 31 | =pod | ||||||||||
| 32 | |||||||||||
| 33 | =encoding UTF-8 | ||||||||||
| 34 | |||||||||||
| 35 | =head1 NAME | ||||||||||
| 36 | |||||||||||
| 37 | PONAPI::DAO::Request::Role::HasFilter - DAO request role - `filter` | ||||||||||
| 38 | |||||||||||
| 39 | =head1 VERSION | ||||||||||
| 40 | |||||||||||
| 41 | version 0.003002 | ||||||||||
| 42 | |||||||||||
| 43 | =head1 AUTHORS | ||||||||||
| 44 | |||||||||||
| 45 | =over 4 | ||||||||||
| 46 | |||||||||||
| 47 | =item * | ||||||||||
| 48 | |||||||||||
| 49 | Mickey Nasriachi <mickey@cpan.org> | ||||||||||
| 50 | |||||||||||
| 51 | =item * | ||||||||||
| 52 | |||||||||||
| 53 | Stevan Little <stevan@cpan.org> | ||||||||||
| 54 | |||||||||||
| 55 | =item * | ||||||||||
| 56 | |||||||||||
| 57 | Brian Fraser <hugmeir@cpan.org> | ||||||||||
| 58 | |||||||||||
| 59 | =back | ||||||||||
| 60 | |||||||||||
| 61 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 62 | |||||||||||
| 63 | This software is copyright (c) 2017 by Mickey Nasriachi, Stevan Little, Brian Fraser. | ||||||||||
| 64 | |||||||||||
| 65 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 66 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 67 | |||||||||||
| 68 | =cut | ||||||||||