Skip to content

Commit 02e2971

Browse files
saimazSimonas Šerlinskas
authored andcommitted
added default result structure for findbyids (#771)
1 parent 15fb1bd commit 02e2971

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
@@ -95,7 +95,7 @@ public function find($id, $routing = null)
9595
/**
9696
* Returns documents by a set of ids
9797
*
98-
* @param array $ids
98+
* @param array $ids
9999
*
100100
* @return DocumentIterator The objects.
101101
*/
@@ -115,7 +115,12 @@ public function findByIds(array $ids)
115115

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

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

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

0 commit comments

Comments
 (0)