Koha::Patron - Koha Patron Object class
my $patrons = Koha::Patrons->search_limit( $params, $attributes );
Returns all the patrons the logged in user is allowed to see
Returns all Patrons which are Housebound choosers.
Returns all Patrons which are Housebound deliverers.
my $patrons = Koha::Patrons->search_upcoming_membership_expires();
The 'before' and 'after' represent the number of days before/after the date that is set by the preference MembershipExpiryDaysNotice. If the pref is 14, before 2 and after 3 then you will get all expires from 12 to 17 days.
Returns a Koha::Patron object for this borrower's guarantor
my $patrons = Koha::Patrons->search_patrons_to_anonymise( { before => $older_than_date, [ library => $library ] } );
This method returns all patrons who has an issue history older than a given date.
Koha::Patrons->search->anonymise_issue_history( { [ before => $older_than_date ] } );
Anonymise issue history (old_issues) for all patrons older than the given date (optional). To make sure all the conditions are met, the caller has the responsibility to call search_patrons_to_anonymise to filter the Koha::Patrons set
Koha::Patrons->search({ some filters here })->delete({ move => 1 });
Delete passed set of patron objects.
Wrapper for Koha::Patron->delete. (We do not want to bypass Koha::Patron
and let DBIx do the job without further housekeeping.)
Includes a move to deletedborrowers if move flag set.
Just like DBIx, the delete will only succeed when all entries could be
deleted. Returns true or throws an exception.
Koha::Patrons->search_unsubscribed;
Returns a set of Koha patron objects for patrons that recently
unsubscribed and are not locked (candidates for locking).
Depends on UnsubscribeReflectionDelay.
Koha::Patrons->search_anonymize_candidates({ locked => 1 });
Returns a set of Koha patron objects for patrons whose account is expired
and locked (if parameter set). These are candidates for anonymizing.
Depends on PatronAnonymizeDelay.
Koha::Patrons->search_anonymized;
Returns a set of Koha patron objects for patron accounts that have been
anonymized before and could be removed.
Depends on PatronRemovalDelay.
Koha::Patrons->search({ some filters })->lock({ expire => 1, remove => 1 })
Lock the passed set of patron objects. Optionally expire and remove holds.
Wrapper around Koha::Patron->lock.
Koha::Patrons->search({ some filters })->anonymize();
Anonymize passed set of patron objects.
Wrapper around Koha::Patron->anonymize.
Kyle M Hall <kyle@bywatersolutions.com>