The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Rapi::Blog::DB::Component::ResultSet::ListAPI - Common "ListAPI" interface

DESCRIPTION

This is a DBIx::Class component for ResultSet classes that is used for the common list_* methods (such as list_posts, list_users) exposed to Rapi::Blog scaffold templates. It provides a mechanism to define input params on a class-by-class basis, but returns a common result packet.

RESULT PACKET

The "ListAPI" call to methods such as list_posts will always return a HashRef result packet containing exactly two keys 'rows' which contains an ArrayRef of matching Row objects and 'meta' which contains additional params and details regarding the data set.

The meta packet is a HashRef containing the following params:

count

Number of items returned (this page)

total

Total number of items (all pages)

page

Page number of current page

pages

Total number of pages

last_page

True if the current page is the last page

complete

True if this page already contains all items

start

The number (out of total items) this page starts at

end

The number (out of total items) this page ends at

remaining

The number of items remaining after this page

before

The number of items in all the pages before this one

limit

The limit of items per page

first_qs

Expressed as a query string, the params that would return the first page (undef if N/A)

last_qs

Expressed as a query string, the params that would return the last page (undef if N/A)

prev_qs

Expressed as a query string, the params that would return the previous page (undef if N/A)

next_qs

Expressed as a query string, the params that would return the next page (undef if N/A)

this_qs

Expressed as a query string, the params that would return this same page

params

The current params for this page as a HashRef

SEE ALSO

AUTHOR

Henry Van Styn <vanstyn@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by IntelliTree Solutions llc.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.