|
Lines 182-187
sub to_api_mapping {
Link Here
|
| 182 |
}; |
182 |
}; |
| 183 |
} |
183 |
} |
| 184 |
|
184 |
|
|
|
185 |
=head3 delete |
| 186 |
|
| 187 |
Overloaded delete method to ensure quota usages are updated. |
| 188 |
|
| 189 |
=cut |
| 190 |
|
| 191 |
sub delete { |
| 192 |
my ($self) = @_; |
| 193 |
|
| 194 |
my $schema = Koha::Database->new->schema; |
| 195 |
$schema->txn_do( |
| 196 |
sub { |
| 197 |
# Update any quota usages linked to this checkout |
| 198 |
Koha::Patron::Quota::Usages->search( { issue_id => $self->issue_id } )->update( { issue_id => undef } ); |
| 199 |
|
| 200 |
return $self->SUPER::delete(); |
| 201 |
} |
| 202 |
); |
| 203 |
} |
| 204 |
|
| 185 |
=head2 Internal methods |
205 |
=head2 Internal methods |
| 186 |
|
206 |
|
| 187 |
=head3 _type |
207 |
=head3 _type |
| 188 |
- |
|
|