Bug 26524 - Add Koha::Acquisition::Basket->orders
Summary: Add Koha::Acquisition::Basket->orders
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-23 18:55 UTC by Tomás Cohen Arazi
Modified: 2021-06-14 21:33 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00


Attachments
Bug 26524: Unit tests (1.60 KB, patch)
2020-09-23 18:59 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 26524: Add Koha::Acquisition::Basket->orders (2.09 KB, patch)
2020-09-23 18:59 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 26524: Unit tests (1.65 KB, patch)
2020-09-23 20:01 UTC, David Nind
Details | Diff | Splinter Review
Bug 26524: Add Koha::Acquisition::Basket->orders (2.13 KB, patch)
2020-09-23 20:01 UTC, David Nind
Details | Diff | Splinter Review
Bug 26524: Unit tests (1.71 KB, patch)
2020-09-26 19:33 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 26524: Add Koha::Acquisition::Basket->orders (2.19 KB, patch)
2020-09-26 19:33 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 26524: Save some processor cycles (1.10 KB, patch)
2020-09-29 14:06 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2020-09-23 18:55:00 UTC
It would be great to have this accessor so developers can access the basket's orderlines in the basket context.
Comment 1 Tomás Cohen Arazi 2020-09-23 18:59:45 UTC
Created attachment 110616 [details] [review]
Bug 26524: Unit tests
Comment 2 Tomás Cohen Arazi 2020-09-23 18:59:52 UTC
Created attachment 110617 [details] [review]
Bug 26524: Add Koha::Acquisition::Basket->orders

This patch adds a handy accessor for a basket's orders. It can be used
to embed orders on an API call or be used in controller scripts to
replace C4::* methods.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Basket.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Comment 3 David Nind 2020-09-23 20:01:36 UTC
Created attachment 110622 [details] [review]
Bug 26524: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2020-09-23 20:01:40 UTC
Created attachment 110623 [details] [review]
Bug 26524: Add Koha::Acquisition::Basket->orders

This patch adds a handy accessor for a basket's orders. It can be used
to embed orders on an API call or be used in controller scripts to
replace C4::* methods.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Basket.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Katrin Fischer 2020-09-26 19:33:08 UTC
Created attachment 110797 [details] [review]
Bug 26524: Unit tests

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2020-09-26 19:33:13 UTC
Created attachment 110798 [details] [review]
Bug 26524: Add Koha::Acquisition::Basket->orders

This patch adds a handy accessor for a basket's orders. It can be used
to embed orders on an API call or be used in controller scripts to
replace C4::* methods.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Basket.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Katrin Fischer 2020-09-26 19:33:53 UTC
Would love to see some code using this new method.
Comment 8 Jonathan Druart 2020-09-29 14:06:57 UTC
Created attachment 110914 [details] [review]
Bug 26524: Save some processor cycles
Comment 9 Tomás Cohen Arazi 2020-09-29 18:38:28 UTC
(In reply to Jonathan Druart from comment #8)
> Created attachment 110914 [details] [review] [review]
> Bug 26524: Save some processor cycles

XD
Comment 10 Jonathan Druart 2020-10-01 09:46:20 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 11 Lucas Gass 2020-10-20 17:28:15 UTC
enhancement will not be backported to 20.05.x