<<

NAME

Koha::Items - Koha Item object set class

API

Class methods

filter_by_for_hold

    my $filtered_items = $items->filter_by_for_hold;

Return the items of the set that are *potentially* holdable. This routine checks only rules defined in the 'Standard rules for all libraries' and should only be used in the context where we don't have a patron to check policies for specifically.

Caller has the responsibility to call C4::Reserves::CanItemBeReserved before placing a hold on one of those items.

filter_by_visible_in_opac

    my $filered_items = $items->filter_by_visible_in_opac(
        {
            [ patron => $patron ]
        }
    );

Returns a new resultset, containing those items that are not expected to be hidden in OPAC for the passed Koha::Patron object that is passed.

The OpacHiddenItems, hidelostitems and OpacHiddenItemsExceptions system preferences are honoured.

filter_out_lost

    my $filered_items = $items->filter_out_lost;

Returns a new resultset, containing those items that are not marked as lost.

filter_by_bookable

  my $filterd_items = $items->filter_by_bookable;

Returns a new resultset, containing only those items that are allowed to be booked.

filter_by_checked_out

  my $checked_out_items = $items->filter_by_checked_out;

Returns a new resultset, containing only those items that are currently checked out.

filter_by_in_transit

  my $in_tranist_items = $items->filter_by_in_transit;

Returns a new resultset, containing only those items that are currently in transit.

filter_by_has_holds

  my $has_hold_items = $items->filter_by_has_holds;

Returns a new resultset, containing only those items that currently have holds.

filter_by_has_recalls

  my $has_recalls_items = $items->filter_by_has_recalls;

Returns a new resultset, containing only those items that currently have recalls.

filter_by_in_bundle

Returns a new resultset, containing only those items that currently are part of a bundle.

filter_by_available

  my $available_items = $items->filter_by_available;

Returns a new resultset, containing only those items that are currently available.

move_to_biblio

 $items->move_to_biblio($to_biblio);

Move items to a given biblio.

batch_update

    Koha::Items->search->batch_update
        {
            new_values => {
                itemnotes => $new_item_notes,
                k         => $k,
            },
            regex_mod => {
                itemnotes_nonpublic => {
                    search => 'foo',
                    replace => 'bar',
                    modifiers => 'gi',
                },
            },
            exclude_from_local_holds_priority => 1|0,
            callback => sub {
                # increment something here
            },
        }
    );

Batch update the items.

Returns ( $report, $self ) Report has 2 keys: * modified_itemnumbers - list of the modified itemnumbers * modified_fields - number of fields modified

Parameters:

new_values

Allows to set a new value for given fields. The key can be one of the item's column name, or one subfieldcode of a MARC subfields not linked with a Koha field

regex_mod

Allows to modify existing subfield's values using a regular expression

exclude_from_local_holds_priority

Set the passed boolean value to items.exclude_from_local_holds_priority

mark_items_returned

Move issues on these items to the old issues table, do not mark items found, or adjust damaged/withdrawn statuses, or fines, or locations.

callback

Callback function to call after an item has been modified

apply_regex

Missing POD for apply_regex.

search

  my $search_result = $object->search( $params, $attributes );

Filters items based on the specified status.

_validate_params

Verify is the input provided with _status is valid.

Since we have to tweak the search for researches involving the _status parameter, if the search involves a _status, we need to check that the provided hashref is compatible with the use case. An hashref is compatible if it is not nested or if the lonely level of nesting is under a "-and" parameter

search_ordered

 $items->search_ordered;

Search and sort items in a specific order, depending if serials are present or not

Internal methods

_type

object_class

AUTHOR

Kyle M Hall <kyle@bywatersolutions.com> Tomas Cohen Arazi <tomascohen@theke.io> Martin Renvoize <martin.renvoize@ptfs-europe.com>

<<