}
);
+__PACKAGE__->register_method(
+ method => 'title_id_by_item_barcode',
+ api_name => 'open-ils.search.multi_home.bib_ids.by_barcode',
+ authoritative => 1,
+ signature => {
+ desc => 'Retrieve bib record ids associated with the copy identified by the given barcode. This includes peer bibs for Multi-Home items.',
+ params => [
+ { desc => 'Item barcode', type => 'string' }
+ ],
+ return => {
+ desc => 'Array of bib record ids. First element is the native bib for the item.'
+ }
+ }
+);
+
+
sub title_id_by_item_barcode {
my( $self, $conn, $barcode ) = @_;
my $e = new_editor();
);
return $e->event unless @$copies;
- return $$copies[0]->call_number->record->id;
+
+ if( $self->api_name =~ /multi_home/ ) {
+ my $multi_home_list = $e->search_biblio_peer_bib_copy_map(
+ [
+ { target_copy => $$copies[0]->id }
+ ]
+ );
+ my @temp = map { $_->peer_record } @{ $multi_home_list };
+ unshift @temp, $$copies[0]->call_number->record->id;
+ return \@temp;
+ } else {
+ return $$copies[0]->call_number->record->id;
+ }
}