<<

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.

dbic_merge_prefetch

    $attributes = $c->dbic_merge_prefetch({ attributes => $attributes, result_set => $result_set });

Generates the DBIC prefetch attribute based on embedded relations, 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.

merge_q_params

    $c->merge_q_params( $filtered_params, $q_params, $result_set );

Merges parameters from $q_params into $filtered_params.

stash_embed

    $c->stash_embed( $c->match->endpoint->pattern->defaults->{'openapi.op_spec'} );

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 }>

_parse_embed

    my $embed = _parse_embed( $string );

Parses $string and outputs data valid for passing to the Kohaa::Object(s)->to_api method.

_merge_embed

    _merge_embed( $parsed_embed, $global_embed );

Merges the hash referenced by $parsed_embed into $global_embed.

<<