Catalyst::Controller::DBIC::API::RequestArguments - Provides Request argument validation
version 2.004004
RequestArguments embodies those arguments that are provided as part of a request or effect validation on request arguments. This Role can be consumed in one of two ways. As this is a parameterized Role, it accepts a single argument at composition time: 'static'. This indicates that those parameters should be stored statically and used as a fallback when the current request doesn't provide them.
count is the number of rows to be returned during paging
page is what page to return while paging
offset specifies where to start the paged result (think SQL LIMIT)
ordered_by is passed to ->search to determine sorting
grouped_by is passed to ->search to determine aggregate results
prefetch is passed to ->search to optimize the number of database fetches for joins
search_exposes limits what can actually be searched. If a certain column isn't indexed or perhaps a BLOB, you can explicitly say which columns can be search and exclude that one.
Like the synopsis in DBIC::API shows, you can declare a "template" of what is allowed (by using an '*'). Each element passed in, will be converted into a Data::DPath and added to the validator.
search contains the raw search parameters. Upon setting, a trigger will fire to format them, set search_parameters, and set search_attributes.
Please see "generate_parameters_attributes" for details on how the format works.
search_parameters stores the formatted search parameters that will be passed to ->search
search_attributes stores the formatted search attributes that will be passed to ->search
search_total_entries stores the total number of entries in a paged search result
select_exposes limits what can actually be selected. Use this to whitelist database functions (such as COUNT).
select is the search attribute that allows you to both limit what is returned in the result set, and also make use of database functions like COUNT.
Please see "select" in DBIx::Class::ResultSet for more details.
as is the search attribute compliment to "select" that allows you to label columns for object inflaction and actually reference database functions like COUNT.
Please see "as" in DBIx::Class::ResultSet for more details.
joins holds the top level JoinBuilder object used to keep track of joins automagically while formatting complex search parameters.
Provides a single handle which returns the 'join' attribute for search_attributes:
build_joins => 'joins'
request_data holds the raw (but deserialized) data for ths request
A Catalyst::Controller::DBIC::API::Validator instance used solely to validate search parameters
A Catalyst::Controller::DBIC::API::Validator instance used solely to validate select parameters
A Catalyst::Controller::DBIC::API::Validator instance used solely to validate prefetch parameters
format_search_parameters iterates through the provided params ArrayRef, calling generate_column_parameters on each one
generate_column_parameters recursively generates properly aliased parameters for search, building a new JoinBuilder each layer of recursion
generate_parameters_attributes takes the raw search arguments and formats the parameters by calling format_search_parameters. Then builds the related attributes, preferring request-provided arguments for things like grouped_by over statically configured options. Finally tacking on the appropriate joins. Returns both formatted search parameters and the search attributes.
This builder method generates the search attributes
Nicholas Perez <nperez@cpan.org>
Luke Saunders <luke.saunders@gmail.com>
Alexander Hartmaier <abraxxa@cpan.org>
Florian Ragwitz <rafl@debian.org>
Oleg Kostyuk <cub.uanic@gmail.com>
This software is copyright (c) 2012 by Luke Saunders, Nicholas Perez, Alexander Hartmaier, et al..
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Catalyst::Controller::DBIC::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Controller::DBIC::API
CPAN shell
perl -MCPAN -e shell install Catalyst::Controller::DBIC::API
For more information on module installation, please visit the detailed CPAN module installation guide.