Welcome Guest, Not a member yet? Register   Sign In
Add index_by() method to Query Builder
#3

(01-21-2018, 11:36 PM)Narf Wrote: Has been suggested before. I don't like it, can break if the column doesn't have a constraint.

And it's not like it's hard to do ...

Code:
// $result is whatever result_array() gave you
// $slug is your index
$result = array_combine(array_column($result, $slug), $result);

Yes, I know, it is not difficult to do. But if it will be a part of Query Builder it will be cleaner and more beautiful.

Anyway, it is not critical feature. Thanks for reply!
Reply


Messages In This Thread
Add index_by() method to Query Builder - by Elias - 01-21-2018, 10:22 AM
RE: Add index_by() method to Query Builder - by Elias - 01-22-2018, 12:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB