@@ -, +, @@ $ kshell k$ prove t/db_dependent/Koha/Old/Holds.t --- Koha/Old/Holds.pm | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) --- a/Koha/Old/Holds.pm +++ a/Koha/Old/Holds.pm @@ -34,11 +34,27 @@ This object represents a set of holds that have been filled or canceled =head1 API -=head2 Class Methods +=head2 Class methods + +=head3 anonymize + + $patron->old_holds->anonymize(); + +Anonymize the given I resultset. =cut -=head3 type +sub anonymize { + my ( $self, $params ) = @_; + + my $anonymous_id = C4::Context->preference('AnonymousPatron') || undef; + + return $self->update( { borrowernumber => $anonymous_id }, { no_triggers => 1 } ); +} + +=head2 Internal methods + +=head3 _type =cut --