Is there a way to have array indexes be item id ?
I mean, instead of having
[ 0 [
‘id’ => 2345
‘name’ => ‘xxxxx’,
‘data’ => ‘mlkjhgui’
]
1 [
‘id’ => 2379
‘name’ => ‘yyyyy’,
‘data’ => ‘hgzrfvafghntbgrf’
]
]
I would like to have :
[ 2345 [
‘id’ => 2345
‘name’ => ‘xxxxx’,
‘data’ => ‘mlkjhgui’
]
2379 [
‘id’ => 2379
‘name’ => ‘yyyyy’,
‘data’ => ‘hgzrfvafghntbgrf’
]
]
I tried to use Cake\Utility\Hash but I can’t make it work. Probably something I don’t understand.