|
Lines 182-210
sub store {
Link Here
|
| 182 |
holding_id => $self->holding_id(), |
182 |
holding_id => $self->holding_id(), |
| 183 |
format => 'marcxml', |
183 |
format => 'marcxml', |
| 184 |
schema => $marcflavour, |
184 |
schema => $marcflavour, |
|
|
185 |
metadata => $marc_record->as_xml_record($marcflavour), |
| 185 |
}; |
186 |
}; |
| 186 |
my $metadata_record = Koha::Holdings::Metadatas->find_or_create($metadata); |
187 |
Koha::Holdings::Metadatas->update_or_create($metadata); |
| 187 |
$metadata_record->metadata($marc_record->as_xml_record($marcflavour)); |
188 |
$guard->commit() if defined $guard; |
| 188 |
|
189 |
|
| 189 |
# request that bib be reindexed so that any holdings-derived fields are updated |
190 |
# request that bib be reindexed so that any holdings-derived fields are updated |
| 190 |
unless ( $params->{skip_record_index} ){ |
191 |
unless ( $params->{skip_record_index} ) { |
| 191 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
192 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
| 192 |
$indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" ); |
193 |
$indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" ); |
| 193 |
} |
194 |
} |
| 194 |
|
195 |
|
| 195 |
if ($result) { |
196 |
logaction('CATALOGUING', $action, $self->holding_id(), 'holding') if C4::Context->preference('CataloguingLog'); |
| 196 |
$guard->commit() if defined $guard; |
|
|
| 197 |
|
| 198 |
# request that bib be reindexed so that any holdings-derived fields are updated |
| 199 |
unless ( $params->{skip_record_index} ) { |
| 200 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
| 201 |
$indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" ); |
| 202 |
} |
| 203 |
|
197 |
|
| 204 |
logaction('CATALOGUING', $action, $self->holding_id(), 'holding') if C4::Context->preference('CataloguingLog'); |
198 |
return $self; |
| 205 |
} |
|
|
| 206 |
|
| 207 |
return $result; |
| 208 |
} |
199 |
} |
| 209 |
|
200 |
|
| 210 |
=head3 delete |
201 |
=head3 delete |