<<

NAME

Koha::Item - Koha Item object class

API

Class methods

effective_itemtype

Returns the itemtype for the item based on whether item level itemtypes are set or not.

home_branch

holding_branch

biblio

my $biblio = $item->biblio;

Return the bibliographic record of this item

biblioitem

my $biblioitem = $item->biblioitem;

Return the biblioitem record of this item

checkout

my $checkout = $item->checkout;

Return the checkout for this item

holds

my $holds = $item->holds(); my $holds = $item->holds($params); my $holds = $item->holds({ found => 'W'});

Return holds attached to an item, optionally accept a hashref of params to pass to search

get_transfer

my $transfer = $item->get_transfer;

Return the transfer if the item is in transit or undef

last_returned_by

Gets and sets the last borrower to return an item.

Accepts and returns Koha::Patron objects

$item->last_returned_by( $borrowernumber );

$last_returned_by = $item->last_returned_by();

can_article_request

my $bool = $item->can_article_request( $borrower )

Returns true if item can be specifically requested

$borrower must be a Koha::Patron object

hidden_in_opac

my $bool = $item->hidden_in_opac({ [ rules => $rules ] })

Returns true if item fields match the hidding criteria defined in $rules. Returns false otherwise.

Takes HASHref that can have the following parameters: OPTIONAL PARAMETERS: $rules : { <field> => [ value_1, ... ], ... }

Note: $rules inherits its structure from the parsed YAML from reading the OpacHiddenItems system preference.

can_be_transferred

$item->can_be_transferred({ to => $to_library, from => $from_library }) Checks if an item can be transferred to given library.

This feature is controlled by two system preferences: UseBranchTransferLimits to enable / disable the feature BranchTransferLimitsType to use either an itemnumber or ccode as an identifier for setting the limitations

Takes HASHref that can have the following parameters: MANDATORY PARAMETERS: $to : Koha::Library OPTIONAL PARAMETERS: $from : Koha::Library # if not given, item holdingbranch # will be used instead

Returns 1 if item can be transferred to $to_library, otherwise 0.

To find out whether at least one item of a Koha::Biblio can be transferred, please see Koha::Biblio->can_be_transferred() instead of using this method for multiple items of the same biblio.

pickup_locations

@pickup_locations = $item->pickup_locations( {patron => $patron } )

Returns possible pickup locations for this item, according to patron's home library (if patron is defined and holds are allowed only from hold groups) and if item can be transferred to each pickup location.

article_request_type

my $type = $item->article_request_type( $borrower )

returns 'yes', 'no', 'bib_only', or 'item_only'

$borrower must be a Koha::Patron object

current_holds

stockrotationitem

  my $sritem = Koha::Item->stockrotationitem;

Returns the stock rotation item associated with the current item.

add_to_rota

  my $item = $item->add_to_rota($rota_id);

Add this item to the rota identified by $ROTA_ID, which means associating it with the first stage of that rota. Should this item already be associated with a rota, then we will move it to the new rota.

has_pending_hold

  my $is_pending_hold = $item->has_pending_hold();

This method checks the tmp_holdsqueue to see if this item has been selected for a hold, but not filled yet and returns true or false

as_marc_field

    my $mss   = C4::Biblio::GetMarcSubfieldStructure( '', { unsafe => 1 } );
    my $field = $item->as_marc_field({ [ mss => $mss ] });

This method returns a MARC::Field object representing the Koha::Item object with the current mappings configuration.

to_api_mapping

This method returns the mapping for representing a Koha::Item object on the API.

Internal methods

_type

AUTHOR

Kyle M Hall <kyle@bywatersolutions.com>

<<