<<

NAME

Koha::REST::Plugin::Query

API

Mojolicious::Plugin methods

register

Helper methods

extract_reserved_params

    my ( $filtered_params, $reserved_params ) = $c->extract_reserved_params($params);

Generates the DBIC query from the query parameters.

dbic_merge_sorting

    $attributes = $c->dbic_merge_sorting({ attributes => $attributes, params => $params });

Generates the DBIC order_by attributes based on $params, and merges into $attributes.

_build_query_params_from_api

    my $params = _build_query_params_from_api( $filtered_params, $reserved_params );

Builds the params for searching on DBIC based on the selected matching algorithm. Valid options are contains, starts_with, ends_with and exact. Default is contains. If other value is passed, a Koha::Exceptions::WrongParameter exception is raised.

Internal methods

_reserved_words

    my $reserved_words = _reserved_words();

_build_order_atom

    my $order_atom = _build_order_atom( $string );

Parses $string and outputs data valid for using in SQL::Abstract order_by attribute according to the following rules:

     string -> I<string>
    +string -> I<{ -asc => string }>
    -string -> I<{ -desc => string }>

<<