Koha::Item::List - Koha Item List object class
Persist the object in the database.
Delete the object from the database
my $items = $list->items;
Returns a resultset of Koha::Items representing the content of this item list.
$list->add_item($itemnumber);
Adds a new Koha::Item to the item list by its itemnumber.
$list->remove_item($itemnumber);
Removes a new Koha::Item from the item list by its itemnumber.
$list->remove_items([100, 250, 310]);
Removes multiple Koha::Item objects from the item list by their itemnumbers.
$list->share({ borrowernumber => $borrowernumber, permission => 'edit' });
Shares the item list with a Koha::Patron, with a given permission ('view' or 'edit').
$list->remove_share($borrowernumber);
Stop sharing the item list with a Koha::Patron.
return unless $list->is_shared_with({ borrowernumber => $borrowernumber });
return unless $list->is_shared_with({ borrowernumber => $borrowernumber, permission => 'edit' });
Returns whether the item list has been shared with the given patron. If 'permission' is specified, the share must be with that permission.
return unless $list->can_be_read_by($patron);
Returns whether the item list may be read by the given patron, accounting for the list visibility, its shares, and the patron's permissions.
return unless $list->can_be_updated_by($patron);
Returns whether the item list may be updated by the given patron, accounting for the list visibility, its shares, and the patron's permissions.
return unless $list->can_be_deleted_by($patron);
Returns whether the item list may be deleted by the given patron, accounting for the list visibility, its shares, and the patron's permissions.
return unless $list->can_be_managed_by($patron);
Returns whether the item list's contents may be managed by the given patron, accounting for the list visibility, its shares, and the patron's permissions.
my $contents = $list->item_list_contents;
Returns a Koha::Item::ListContents representing the contents of this item list.
my $shares = $list->item_list_shares;
Returns a Koha::Item::ListShares representing the shares of this item list.
Returns the mapping required to represent this object through the REST API.
Overloaded to_api method to add permission booleans
Helper method to check whether a patron has a specified level of access to an item list, taking into account ownership, shares, and patron permissions.
Takes a HASHref with the following parameters: 'patron': the patron the check the access for 'subpermission' (optional): if specified, the item_lists subpermission required by the patron if they do not have explicit access through ownership or shares 'share_permission': the required permission level of a share to grant this access ('view' or 'edit')
The Result type of this object