|
Lines 320-325
sub to_api {
Link Here
|
| 320 |
return [ map { $_->to_api } $self->as_list ]; |
320 |
return [ map { $_->to_api } $self->as_list ]; |
| 321 |
} |
321 |
} |
| 322 |
|
322 |
|
|
|
323 |
=head3 attributes_from_api |
| 324 |
|
| 325 |
my $attributes = $objects->attributes_from_api( $api_attributes ); |
| 326 |
|
| 327 |
Translates attributes from the API to DBIC |
| 328 |
|
| 329 |
=cut |
| 330 |
|
| 331 |
sub attributes_from_api { |
| 332 |
my ( $self, $attributes ) = @_; |
| 333 |
|
| 334 |
$self->{_singular_object} ||= $self->object_class->new(); |
| 335 |
return $self->{_singular_object}->attributes_from_api( $attributes ); |
| 336 |
} |
| 337 |
|
| 323 |
=head3 Koha::Objects->_wrap |
338 |
=head3 Koha::Objects->_wrap |
| 324 |
|
339 |
|
| 325 |
wraps the DBIC object in a corresponding Koha object |
340 |
wraps the DBIC object in a corresponding Koha object |