|
Lines 1566-1596
sub to_api {
Link Here
|
| 1566 |
return $json_patron; |
1566 |
return $json_patron; |
| 1567 |
} |
1567 |
} |
| 1568 |
|
1568 |
|
| 1569 |
=head3 attributes_from_api |
|
|
| 1570 |
|
| 1571 |
my $attrs = $patron->attributes_from_api( $attrs ); |
| 1572 |
|
| 1573 |
Overloaded method that implement specific data transformations after |
| 1574 |
calling the original Koha::Object->attributes_from_api method. |
| 1575 |
|
| 1576 |
=cut |
| 1577 |
|
| 1578 |
sub attributes_from_api { |
| 1579 |
my ( $self, $attrs ) = @_; |
| 1580 |
|
| 1581 |
$attrs = $self->SUPER::attributes_from_api( $attrs ); |
| 1582 |
|
| 1583 |
if ( exists $attrs->{lastseen} ) { |
| 1584 |
$attrs->{lastseen} = dt_from_string($attrs->{lastseen}, 'rfc3339'); |
| 1585 |
} |
| 1586 |
|
| 1587 |
if ( exists $attrs->{updated_on} ) { |
| 1588 |
$attrs->{updated_on} = dt_from_string($attrs->{updated_on}, 'rfc3339'); |
| 1589 |
} |
| 1590 |
|
| 1591 |
return $attrs; |
| 1592 |
} |
| 1593 |
|
| 1594 |
=head3 to_api_mapping |
1569 |
=head3 to_api_mapping |
| 1595 |
|
1570 |
|
| 1596 |
This method returns the mapping for representing a Koha::Patron object |
1571 |
This method returns the mapping for representing a Koha::Patron object |
| 1597 |
- |
|
|