@@ -, +, @@ $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t --- Koha/Acquisition/Basket.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) --- a/Koha/Acquisition/Basket.pm +++ a/Koha/Acquisition/Basket.pm @@ -21,6 +21,7 @@ use Modern::Perl; use Koha::Database; use Koha::Acquisition::BasketGroups; +use Koha::Patrons; use base qw( Koha::Object Koha::Object::Mixin::AdditionalFields ); @@ -30,7 +31,7 @@ Koha::Acquisition::Basket - Koha Basket Object class =head1 API -=head2 Class Methods +=head2 Class methods =cut @@ -46,6 +47,20 @@ sub bookseller { return Koha::Acquisition::Bookseller->_new_from_dbic( $bookseller_rs ); } +=head3 creator + + my $creator = $basket->creator; + +Returns the I for the basket creator. + +=cut + +sub creator { + my ($self) = @_; + return Koha::Patrons->find( $self->authorisedby ) + if $self->authorisedby; +} + =head3 basket_group Returns the basket group associated to this basket --