Bug 18093 - Add the Koha::Objects->get_column method
Summary: Add the Koha::Objects->get_column method
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 18295
  Show dependency treegraph
 
Reported: 2017-02-10 08:39 UTC by Jonathan Druart
Modified: 2017-12-07 22:15 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 18093: Add Koha::Objects->get_column (1.68 KB, patch)
2017-02-10 08:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18093: Add Koha::Objects->get_column (1.85 KB, patch)
2017-02-10 13:47 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18093: Koha::Objects->get_column should not return a DBIC object (1.92 KB, patch)
2017-03-15 21:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18093: Add Koha::Objects->get_column (1.95 KB, patch)
2017-03-16 07:39 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18093: Koha::Objects->get_column should not return a DBIC object (2.01 KB, patch)
2017-03-16 07:39 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2017-02-10 08:39:49 UTC

    
Comment 1 Jonathan Druart 2017-02-10 08:45:59 UTC
Created attachment 60104 [details] [review]
Bug 18093: Add Koha::Objects->get_column

Test plan:
  prove t/db_dependent/Koha/Objects.t
Should return green
Comment 2 Marc Véron 2017-02-10 13:47:48 UTC
Created attachment 60115 [details] [review]
Bug 18093: Add Koha::Objects->get_column

Test plan:
  prove t/db_dependent/Koha/Objects.t
Should return green

Followed test plan, result as expected
Signed-off-by: Marc Véron <veron@veron.ch>
Comment 3 Marcel de Rooy 2017-02-27 18:27:55 UTC
This method now returns a DBIx::Class::ResultSetColumn object.
I am wondering if we should do that. It seems not to fit in the current design of Koha::Object[s].
Maybe you need to elaborate first on how we are going to use this method first ?
Comment 4 Jonathan Druart 2017-02-28 08:03:32 UTC
I wanted to add a follow-up for something but finally did not need it.
It is not important for now, but we may need it later.
Comment 5 Marcel de Rooy 2017-02-28 08:49:57 UTC
(In reply to Jonathan Druart from comment #4)
> I wanted to add a follow-up for something but finally did not need it.
> It is not important for now, but we may need it later.

How would you use it?
Koha Objects more-or-less encapsulate DBIx, but here you do not.
Would returning an array of values be enough?
Comment 6 Jonathan Druart 2017-03-15 21:59:53 UTC
Created attachment 61154 [details] [review]
Bug 18093: Koha::Objects->get_column should not return a DBIC object
Comment 7 Jonathan Druart 2017-03-15 22:00:40 UTC
(In reply to Marcel de Rooy from comment #5)
> (In reply to Jonathan Druart from comment #4)
> > I wanted to add a follow-up for something but finally did not need it.
> > It is not important for now, but we may need it later.
> 
> How would you use it?

I would have used it how I did in the test.

> Koha Objects more-or-less encapsulate DBIx, but here you do not.
> Would returning an array of values be enough?

Do you think it's better with this second patch?
Comment 8 Marcel de Rooy 2017-03-16 07:39:13 UTC
Created attachment 61155 [details] [review]
Bug 18093: Add Koha::Objects->get_column

Test plan:
  prove t/db_dependent/Koha/Objects.t
Should return green

Followed test plan, result as expected
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Marcel de Rooy 2017-03-16 07:39:18 UTC
Created attachment 61156 [details] [review]
Bug 18093: Koha::Objects->get_column should not return a DBIC object

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Kyle M Hall 2017-04-03 10:37:51 UTC
Pushed to master for 17.05, thanks Jonathan!
Comment 11 Katrin Fischer 2017-04-10 21:21:29 UTC
This won't get ported back to 16.11.x as it is an enhancement.