JsonSQL::Param::ConditionDispatcher - A dispatcher module that parses condition statements to create the appropriate JsonSQL Condition objects.
version 0.41
This is a supporting module used by JsonSQL::Query modules for parsing condition operators as parameters for conditional clauses.
To use this:
my $condObj = JsonSQL::Param::ConditionDispatcher->parse($conditionhashref, $queryObj, $default_table_rules); if ( eval { $condObj->is_error } ) { return "Could not create condition object: $condObj->{message}"; } else { ... }
The $conditionhashref must contain a single key which is the operator for the condition statement. The operator gets mapped to the appropriate module to load as defined in the %opmap hash. The conditional modules are subclasses of JsonSQL::Param::Condition and reside in JsonSQL::Param::Conditions. The value of the operator key is a hash of args to apply to the operator. For example, a TestCondition needs to have "field" and "value" properties.
The collection of conditional modules is fairly complete, but others can be created if need be.
Serves as a dispatcher to load the appropriate JsonSQL::Param::Conditions:: class, and create a new instance which is then returned.
Chris Hoefler <bhoefler@draper.com>
This software is copyright (c) 2017 by Chris Hoefler.
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 JsonSQL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JsonSQL
CPAN shell
perl -MCPAN -e shell install JsonSQL
For more information on module installation, please visit the detailed CPAN module installation guide.