Lines 175-196
sub store {
Link Here
|
175 |
holding_id => $self->holding_id(), |
175 |
holding_id => $self->holding_id(), |
176 |
format => 'marcxml', |
176 |
format => 'marcxml', |
177 |
schema => $marcflavour, |
177 |
schema => $marcflavour, |
|
|
178 |
metadata => $marc_record->as_xml_record($marcflavour), |
178 |
}; |
179 |
}; |
179 |
my $metadata_record = Koha::Holdings::Metadatas->find_or_create($metadata); |
180 |
Koha::Holdings::Metadatas->update_or_create($metadata); |
180 |
$metadata_record->metadata($marc_record->as_xml_record($marcflavour)); |
181 |
$guard->commit() if defined $guard; |
181 |
|
|
|
182 |
$result = $metadata_record->store() ? $self : undef; |
183 |
|
184 |
if ($result) { |
185 |
$guard->commit() if defined $guard; |
186 |
|
182 |
|
187 |
# request that bib be reindexed so that any holdings-derived fields are updated |
183 |
# request that bib be reindexed so that any holdings-derived fields are updated |
188 |
C4::Biblio::ModZebra( $self->biblionumber(), 'specialUpdate', 'biblioserver' ); |
184 |
C4::Biblio::ModZebra( $self->biblionumber(), 'specialUpdate', 'biblioserver' ); |
189 |
|
185 |
|
190 |
logaction('CATALOGUING', $action, $self->holding_id(), 'holding') if C4::Context->preference('CataloguingLog'); |
186 |
logaction('CATALOGUING', $action, $self->holding_id(), 'holding') if C4::Context->preference('CataloguingLog'); |
191 |
} |
|
|
192 |
|
187 |
|
193 |
return $result; |
188 |
return $self; |
194 |
} |
189 |
} |
195 |
|
190 |
|
196 |
=head3 delete |
191 |
=head3 delete |