Koha::Item - Koha Item object class
$item->store;
$params can take an optional 'skip_record_index' parameter. If set, the reindexation process will not happen (index_records not called)
NOTE: This is a temporary fix to answer a performance issue when lot of items are added (or modified) at the same time. The correct way to fix this is to make the ES reindexation process async. You should not turn it on if you do not understand what it is doing exactly.
returns 1 if the item is safe to delete,
"book_on_loan" if the item is checked out,
"not_same_branch" if the item is blocked by independent branches,
"book_reserved" if the there are holds aganst the item, or
"linked_analytics" if the item has linked analytic records.
"last_item_for_hold" if the item is the last one on a record on which a biblio-level hold is placed
my $is_moved = $item->move_to_deleted;
Move an item to the deleteditems table. This can be done before deleting an item, to make sure the data are not completely deleted.
Returns the itemtype for the item based on whether item level itemtypes are set or not.
my $biblio = $item->biblio;
Return the bibliographic record of this item
my $biblioitem = $item->biblioitem;
Return the biblioitem record of this item
my $checkout = $item->checkout;
Return the checkout for this item
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
my $transfer = $item->get_transfer;
Return the transfer if the item is in transit or undef
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();
my $bool = $item->can_article_request( $borrower )
Returns true if item can be specifically requested
$borrower must be a Koha::Patron object
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.
$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 = $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.
my $type = $item->article_request_type( $borrower )
returns 'yes', 'no', 'bib_only', or 'item_only'
$borrower must be a Koha::Patron object
my $sritem = Koha::Item->stockrotationitem;
Returns the stock rotation item associated with the current item.
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.
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
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.
Returns the branchcode to be recorded in statistics renewal of the item
Return the cover images associated with this item.
$self->_set_found_trigger
Finds the most recent lost item charge for this item and refunds the patron appropriately, taking into account any payments or writeoffs already applied against the charge.
Internal function, not exported, called only by Koha::Item->store.
This method returns the mapping for representing a Koha::Item object on the API.
my $itemtype = $item->itemtype; Returns Koha object for effective itemtype
Helper method that takes care of calling all plugin hooks
Kyle M Hall <kyle@bywatersolutions.com>