Skip to content

Commit e5517c8

Browse files
IlyaChuvaevnekufa
authored andcommitted
create instance field id maybe not first in schema
1 parent d1d03cd commit e5517c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Space.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function castIndex(array $fields, bool $optionalIndex = false): ?array
126126

127127
public function create(array $data)
128128
{
129-
if (!array_key_exists('id', $data) && $this->fields[0] == 'id') {
129+
if (!array_key_exists('id', $data) && in_array('id', $this->fields)) {
130130
try {
131131
[$data['id']] = $this->mapper->client->call("box.sequence.$this->name:next");
132132
} catch (RequestFailed $e) {

0 commit comments

Comments
 (0)