| 1 | # ABSTRACT: Constants used by PONAPI::DAO and PONAPI repositories | ||
| 2 | package PONAPI::Constants; | ||
| 3 | |||
| 4 | 8 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 8 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 8 | my $constants; | |
| 8 | BEGIN { | ||
| 9 | 8 | ▶ | $constants = { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | PONAPI_UPDATED_EXTENDED => 100, | ||
| 11 | PONAPI_UPDATED_NORMAL => 101, | ||
| 12 | PONAPI_UPDATED_NOTHING => 102, | ||
| 13 | }; | ||
| 14 | |||
| 15 | 8 | require constant; constant->import($constants); | |
| 16 | 8 | require Exporter; our @ISA = qw(Exporter); | |
| 17 | 8 | our @EXPORT = ( keys %$constants, | |
| 18 | qw/ | ||
| 19 | %PONAPI_UPDATE_RETURN_VALUES | ||
| 20 | /, | ||
| 21 | ); | ||
| 22 | } | ||
| 23 | |||
| 24 | 8 | our (%PONAPI_UPDATE_RETURN_VALUES); | |
| 25 | |||
| 26 | 8 | $PONAPI_UPDATE_RETURN_VALUES{+PONAPI_UPDATED_EXTENDED} = 1; | |
| 27 | 8 | $PONAPI_UPDATE_RETURN_VALUES{+PONAPI_UPDATED_NORMAL} = 1; | |
| 28 | 8 | $PONAPI_UPDATE_RETURN_VALUES{+PONAPI_UPDATED_NOTHING} = 1; | |
| 29 | |||
| 30 | 8 | 1; | |
| 31 | |||
| 32 | __END__ | ||
| 33 | |||
| 34 | =pod | ||
| 35 | |||
| 36 | =encoding UTF-8 | ||
| 37 | |||
| 38 | =head1 NAME | ||
| 39 | |||
| 40 | PONAPI::Constants - Constants used by PONAPI::DAO and PONAPI repositories | ||
| 41 | |||
| 42 | =head1 VERSION | ||
| 43 | |||
| 44 | version 0.003002 | ||
| 45 | |||
| 46 | =head1 SYNOPSIS | ||
| 47 | |||
| 48 | use PONAPI::Constants; | ||
| 49 | sub update { | ||
| 50 | ... | ||
| 51 | |||
| 52 | return $updated_more_rows_than_requested | ||
| 53 | ? PONAPI_UPDATED_EXTENDED | ||
| 54 | : PONAPI_UPDATED_NORMAL; | ||
| 55 | } | ||
| 56 | |||
| 57 | =head1 EXPORTS | ||
| 58 | |||
| 59 | =head2 PONAPI_UPDATED_NORMAL | ||
| 60 | |||
| 61 | The update-like operation did as requested, as no more. | ||
| 62 | |||
| 63 | =head2 PONAPI_UPDATED_EXTENDED | ||
| 64 | |||
| 65 | The update-like operation did B<more> than requested; maybe it added rows, | ||
| 66 | or updated another related table. | ||
| 67 | |||
| 68 | =head2 PONAPI_UPDATED_NOTHING | ||
| 69 | |||
| 70 | The update-like operation was a no-op. This can happen in a SQL implementation | ||
| 71 | when modifying a resource that doesn't exist, for example. | ||
| 72 | |||
| 73 | =head1 AUTHORS | ||
| 74 | |||
| 75 | =over 4 | ||
| 76 | |||
| 77 | =item * | ||
| 78 | |||
| 79 | Mickey Nasriachi <mickey@cpan.org> | ||
| 80 | |||
| 81 | =item * | ||
| 82 | |||
| 83 | Stevan Little <stevan@cpan.org> | ||
| 84 | |||
| 85 | =item * | ||
| 86 | |||
| 87 | Brian Fraser <hugmeir@cpan.org> | ||
| 88 | |||
| 89 | =back | ||
| 90 | |||
| 91 | =head1 COPYRIGHT AND LICENSE | ||
| 92 | |||
| 93 | This software is copyright (c) 2017 by Mickey Nasriachi, Stevan Little, Brian Fraser. | ||
| 94 | |||
| 95 | This is free software; you can redistribute it and/or modify it under | ||
| 96 | the same terms as the Perl 5 programming language system itself. | ||
| 97 | |||
| 98 | =cut | ||