- if ( scalar (keys %$embed) ) {
- # Augment the request response with patron details if appropriate
- if ( $embed->{patron} ) {
- my $patron = $self->patron;
- $object->{patron} = {
- firstname => $patron->firstname,
- surname => $patron->surname,
- cardnumber => $patron->cardnumber
- };
- }
- # Augment the request response with metadata details if appropriate
- if ( $embed->{metadata} ) {
- $object->{metadata} = $self->metadata;
- }
- # Augment the request response with status details if appropriate
- if ( $embed->{capabilities} ) {
- $object->{capabilities} = $self->capabilities;
- }
- # Augment the request response with library details if appropriate
- if ( $embed->{branch} ) {
- $object->{branch} = Koha::Libraries->find(
- $self->branchcode
- )->TO_JSON;
- }
- }
-