Skip to content

Commit 4212408

Browse files
authored
added default result structure for findbyids (#771)
1 parent 04920a2 commit 4212408

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Service/Repository.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function find($id, $routing = null)
9696
/**
9797
* Returns documents by a set of ids
9898
*
99-
* @param array $ids
99+
* @param array $ids
100100
*
101101
* @return DocumentIterator The objects.
102102
*/
@@ -116,7 +116,12 @@ public function findByIds(array $ids)
116116

117117
$mgetResponse = $manager->getClient()->mget($args);
118118

119-
$return = [];
119+
$return = [
120+
'hits' => [
121+
'hits' => [],
122+
'total' => 0,
123+
]
124+
];
120125

121126
foreach ($mgetResponse['docs'] as $item) {
122127
if ($item['found']) {

0 commit comments

Comments
 (0)