|
Lines 162-167
sub to_api_mapping {
Link Here
|
| 162 |
}; |
162 |
}; |
| 163 |
} |
163 |
} |
| 164 |
|
164 |
|
|
|
165 |
=head3 delete |
| 166 |
|
| 167 |
Overloaded delete method to ensure quota usages are updated. |
| 168 |
|
| 169 |
=cut |
| 170 |
|
| 171 |
sub delete { |
| 172 |
my ($self) = @_; |
| 173 |
|
| 174 |
my $schema = Koha::Database->new->schema; |
| 175 |
$schema->txn_do( |
| 176 |
sub { |
| 177 |
# Update any quota usages linked to this checkout |
| 178 |
Koha::Patron::Quota::Usages->search( { issue_id => $self->issue_id } )->update( { issue_id => undef } ); |
| 179 |
|
| 180 |
return $self->SUPER::delete(); |
| 181 |
} |
| 182 |
); |
| 183 |
} |
| 184 |
|
| 165 |
=head2 Internal methods |
185 |
=head2 Internal methods |
| 166 |
|
186 |
|
| 167 |
=head3 _type |
187 |
=head3 _type |
| 168 |
- |
|
|