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