Index all obects by id

This commit is contained in:
Tim 2021-10-23 22:02:24 +02:00
parent 653744b751
commit 4dd7ecd030

View File

@ -99,7 +99,8 @@ class GrocyClient
$array = $this->client->get(sprintf('objects/%s', $entity), compact('order', 'limit', 'offset'));
$objects = [];
foreach ($array as $rawObject) {
$objects[] = ObjectTransformer::denormalize($rawObject, $entity);
$object = ObjectTransformer::denormalize($rawObject, $entity);
$objects[$object->getId()] = $object;
}
return $objects;