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