use Koha::Database;
use Koha::DateUtils qw( dt_from_string );
use Koha::Acquisition::BasketGroups;
+use Koha::Acquisition::Orders;
use Koha::Patrons;
use base qw( Koha::Object Koha::Object::Mixin::AdditionalFields );
return Koha::Acquisition::BasketGroup->_new_from_dbic( $basket_group_rs );
}
+=head3 orders
+
+ my $orders = $basket->orders;
+
+Returns a Koha::Acquisition::Orders resultset, with the orders linked
+to this basket.
+
+=cut
+
+sub orders {
+ my ($self) = @_;
+
+ my $orders_rs = $self->_result->orders;
+ return Koha::Acquisition::Orders->_new_from_dbic( $orders_rs );
+}
+
=head3 effective_create_items
Returns C<create_items> for this basket, falling back to C<AcqCreateItem> if unset.
},
);
+__PACKAGE__->has_many(
+ "orders",
+ "Koha::Schema::Result::Aqorder",
+ { "foreign.basketno" => "self.basketno" },
+ { cascade_copy => 0, cascade_delete => 0 },
+);
+
sub koha_object_class {
'Koha::Acquisition::Basket';
}