Bug 21846: Add Koha::Tags::Approval(s) and Koha::Tags::Index(es)
[srvgit] / Koha / Checkout.pm
index a1a67d6..b7a752c 100644 (file)
@@ -25,6 +25,7 @@ use Carp;
 use Koha::Database;
 use DateTime;
 use Koha::DateUtils;
+use Koha::Items;
 
 use base qw(Koha::Object);
 
@@ -59,6 +60,34 @@ sub is_overdue {
     return $is_overdue;
 }
 
+=head3 item
+
+my $item = $checkout->item;
+
+Return the checked out item
+
+=cut
+
+sub item {
+    my ( $self ) = @_;
+    my $item_rs = $self->_result->item;
+    return Koha::Item->_new_from_dbic( $item_rs );
+}
+
+=head3 patron
+
+my $patron = $checkout->patron
+
+Return the patron for who the checkout has been done
+
+=cut
+
+sub patron {
+    my ( $self ) = @_;
+    my $patron_rs = $self->_result->borrower;
+    return Koha::Patron->_new_from_dbic( $patron_rs );
+}
+
 =head3 type
 
 =cut