Index all obects by id
This commit is contained in:
parent
653744b751
commit
4dd7ecd030
@ -99,7 +99,8 @@ class GrocyClient
|
|||||||
$array = $this->client->get(sprintf('objects/%s', $entity), compact('order', 'limit', 'offset'));
|
$array = $this->client->get(sprintf('objects/%s', $entity), compact('order', 'limit', 'offset'));
|
||||||
$objects = [];
|
$objects = [];
|
||||||
foreach ($array as $rawObject) {
|
foreach ($array as $rawObject) {
|
||||||
$objects[] = ObjectTransformer::denormalize($rawObject, $entity);
|
$object = ObjectTransformer::denormalize($rawObject, $entity);
|
||||||
|
$objects[$object->getId()] = $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $objects;
|
return $objects;
|
||||||
|
Loading…
Reference in New Issue
Block a user