We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e0f4be commit 8c575d9Copy full SHA for 8c575d9
src/Space.php
@@ -11,6 +11,7 @@
11
use Tarantool\Client\Response;
12
use Tarantool\Client\Schema\Criteria;
13
use Tarantool\Client\Schema\Operations;
14
+use ValueError;
15
16
class Space
17
{
@@ -233,7 +234,15 @@ public function getInstance(array $tuple)
233
234
return $instance;
235
}
236
- return array_combine($this->fields, $tuple);
237
+ try {
238
+ return array_combine($this->fields, $tuple);
239
+ } catch (ValueError $_) {
240
+ $instance = [];
241
+ foreach ($this->fields as $n => $field) {
242
+ $instance[$field] = array_key_exists($n, $tuple) ? $tuple[$n] : null;
243
+ }
244
+ return $instance;
245
246
247
248
public function getKey($query, ?array $index = null): array
0 commit comments