Lines 219-224
sub to_api_mapping {
Link Here
|
219 |
}; |
219 |
}; |
220 |
} |
220 |
} |
221 |
|
221 |
|
|
|
222 |
=head3 to_api |
223 |
|
224 |
my $json = $av->to_api; |
225 |
|
226 |
Overloaded method that returns a JSON representation of the Koha::Acquisition::Bookseller object, |
227 |
suitable for API output. |
228 |
|
229 |
=cut |
230 |
|
231 |
sub to_api { |
232 |
my ( $self, $params ) = @_; |
233 |
|
234 |
my $response = $self->SUPER::to_api($params); |
235 |
my $overrides = {}; |
236 |
|
237 |
if ( $self->interfaces ) { |
238 |
my $interfaces = $self->interfaces->as_list; |
239 |
my @updated_interfaces; |
240 |
foreach my $interface ( @{$interfaces} ) { |
241 |
$interface->password( $interface->plain_text_password ); |
242 |
push @updated_interfaces, $interface->unblessed; |
243 |
} |
244 |
$overrides->{interfaces} = ( \@updated_interfaces ); |
245 |
} |
246 |
|
247 |
return { %$response, %$overrides }; |
248 |
} |
249 |
|
222 |
=head2 Internal methods |
250 |
=head2 Internal methods |
223 |
|
251 |
|
224 |
=head3 _type |
252 |
=head3 _type |
225 |
- |
|
|