Bug 18093

Summary: Add the Koha::Objects->get_column method
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: enhancement    
Priority: P5 - low CC: katrin.fischer, kyle, m.de.rooy, veron
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 18295    
Attachments: Bug 18093: Add Koha::Objects->get_column
Bug 18093: Add Koha::Objects->get_column
Bug 18093: Koha::Objects->get_column should not return a DBIC object
Bug 18093: Add Koha::Objects->get_column
Bug 18093: Koha::Objects->get_column should not return a DBIC object

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.