|
Lines 105-117
type. Currently only I<MARC::Record> objects are returned.
Link Here
|
| 105 |
=cut |
105 |
=cut |
| 106 |
|
106 |
|
| 107 |
sub metadata_record { |
107 |
sub metadata_record { |
| 108 |
my ($self, $params) = @_; |
108 |
my ( $self, $params ) = @_; |
| 109 |
|
109 |
|
| 110 |
my $patron = $params->{patron}; |
110 |
my $patron = $params->{patron}; |
| 111 |
|
111 |
|
| 112 |
my $record = $self->metadata->record; |
112 |
my $record = $self->metadata->record; |
| 113 |
|
113 |
|
| 114 |
if ( $params->{embed_items} or $params->{opac} ) { |
114 |
if ( $params->{embed_items} or $params->{opac} ) { |
|
|
115 |
|
| 115 |
# There's need for a RecordProcessor, let's do it! |
116 |
# There's need for a RecordProcessor, let's do it! |
| 116 |
my @filters; |
117 |
my @filters; |
| 117 |
my $options = { |
118 |
my $options = { |
|
Lines 119-130
sub metadata_record {
Link Here
|
| 119 |
frameworkcode => $self->frameworkcode, |
120 |
frameworkcode => $self->frameworkcode, |
| 120 |
}; |
121 |
}; |
| 121 |
|
122 |
|
| 122 |
if ($params->{embed_items}) { |
123 |
if ( $params->{embed_items} ) { |
| 123 |
push @filters, 'EmbedItems'; |
124 |
push @filters, 'EmbedItems'; |
| 124 |
if ($params->{opac}) { |
125 |
if ( $params->{opac} ) { |
| 125 |
$options->{items} = $self->items->filter_by_visible_in_opac( |
126 |
$options->{items} = $self->items->filter_by_visible_in_opac( |
| 126 |
{ |
127 |
{ |
| 127 |
( $params->{patron} ? patron => $params->{patron} : ()) |
128 |
( |
|
|
129 |
$params->{patron} ? ( patron => $params->{patron} ) : () |
| 130 |
) |
| 128 |
} |
131 |
} |
| 129 |
); |
132 |
); |
| 130 |
} |
133 |
} |
|
Lines 148-154
sub metadata_record {
Link Here
|
| 148 |
} |
151 |
} |
| 149 |
); |
152 |
); |
| 150 |
|
153 |
|
| 151 |
$rp->process( $record ); |
154 |
$rp->process($record); |
| 152 |
} |
155 |
} |
| 153 |
|
156 |
|
| 154 |
return $record; |
157 |
return $record; |
| 155 |
- |
|
|