@@ -, +, @@ --- Koha/Object.pm | 11 +++++++++++ Koha/Schema/Result/Borrower.pm | 3 +++ 2 files changed, 14 insertions(+) --- a/Koha/Object.pm +++ a/Koha/Object.pm @@ -219,6 +219,17 @@ sub unblessed { return { $self->_result->get_columns }; } +=head3 $object->get_from_storage; + +=cut + +sub get_from_storage { + my ( $self, $attrs ) = @_; + my $stored_object = $self->_result->get_from_storage($attrs); + my $object_class = Koha::Object::_get_object_class( $self->_result->result_class ); + return $object_class->_new_from_dbic($stored_object); +} + =head3 $object->TO_JSON Returns an unblessed representation of the object, suitable for JSON output. --- a/Koha/Schema/Result/Borrower.pm +++ a/Koha/Schema/Result/Borrower.pm @@ -1433,5 +1433,8 @@ __PACKAGE__->add_columns( sub koha_objects_class { 'Koha::Patrons'; } +sub koha_object_class { + 'Koha::Patron'; +} 1; --