|
Lines 140-152
type. Currently only I<MARC::Record> objects are returned.
Link Here
|
| 140 |
=cut |
140 |
=cut |
| 141 |
|
141 |
|
| 142 |
sub metadata_record { |
142 |
sub metadata_record { |
| 143 |
my ($self, $params) = @_; |
143 |
my ( $self, $params ) = @_; |
| 144 |
|
144 |
|
| 145 |
my $patron = $params->{patron}; |
145 |
my $patron = $params->{patron}; |
| 146 |
|
146 |
|
| 147 |
my $record = $self->metadata->record; |
147 |
my $record = $self->metadata->record; |
| 148 |
|
148 |
|
| 149 |
if ( $params->{embed_items} or $params->{opac} ) { |
149 |
if ( $params->{embed_items} or $params->{opac} ) { |
|
|
150 |
|
| 150 |
# There's need for a RecordProcessor, let's do it! |
151 |
# There's need for a RecordProcessor, let's do it! |
| 151 |
my @filters; |
152 |
my @filters; |
| 152 |
my $options = { |
153 |
my $options = { |
|
Lines 154-165
sub metadata_record {
Link Here
|
| 154 |
frameworkcode => $self->frameworkcode, |
155 |
frameworkcode => $self->frameworkcode, |
| 155 |
}; |
156 |
}; |
| 156 |
|
157 |
|
| 157 |
if ($params->{embed_items}) { |
158 |
if ( $params->{embed_items} ) { |
| 158 |
push @filters, 'EmbedItems'; |
159 |
push @filters, 'EmbedItems'; |
| 159 |
if ($params->{opac}) { |
160 |
if ( $params->{opac} ) { |
| 160 |
$options->{items} = $self->items->filter_by_visible_in_opac( |
161 |
$options->{items} = $self->items->filter_by_visible_in_opac( |
| 161 |
{ |
162 |
{ |
| 162 |
( $params->{patron} ? patron => $params->{patron} : ()) |
163 |
( |
|
|
164 |
$params->{patron} ? ( patron => $params->{patron} ) : () |
| 165 |
) |
| 163 |
} |
166 |
} |
| 164 |
); |
167 |
); |
| 165 |
} |
168 |
} |
|
Lines 183-189
sub metadata_record {
Link Here
|
| 183 |
} |
186 |
} |
| 184 |
); |
187 |
); |
| 185 |
|
188 |
|
| 186 |
$rp->process( $record ); |
189 |
$rp->process($record); |
| 187 |
} |
190 |
} |
| 188 |
|
191 |
|
| 189 |
return $record; |
192 |
return $record; |
| 190 |
- |
|
|