<<

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.

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.

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

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>

<<