Query result as an indexed array or object by index of choice |
(11-16-2020, 11:16 AM)paulbalandan Wrote: There is already a findColumn method which uses array_column for single result. Maybe we can have an analogous findAllColumn() which will do the indexing for set of results.findColumn() uses find() without any argument which means it finds and returns all matching rows. Not just a single row (result). It uses array_column() without 3rd argument so it doesn't handle any array indexing. I think it would be inconsistent to have:
(11-16-2020, 11:16 AM)paulbalandan Wrote: Perhaps you can send in a PR in the Github repo?I did, let's see how it goes: #3895 Model: support returning array indexed by a specified column |
Messages In This Thread |
Query result as an indexed array or object by index of choice - by Leo - 04-22-2020, 12:04 PM
RE: Query result as an indexed array or object by index of choice - by rmilecki - 11-14-2020, 02:59 PM
RE: Query result as an indexed array or object by index of choice - by paulbalandan - 11-16-2020, 11:16 AM
RE: Query result as an indexed array or object by index of choice - by rmilecki - 11-16-2020, 01:26 PM
RE: Query result as an indexed array or object by index of choice - by paulbalandan - 11-17-2020, 08:46 AM
|