Skip to content

Commit acf543b

Browse files
committed
find or create tuple pass
1 parent 3873b49 commit acf543b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Procedure/FindOrCreate.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ public function execute(Space $space, array $params, array $query = null): array
6666
$key[$format[$field]['name']] = $result['tuple'][$field];
6767
}
6868
return [
69-
'key' => $key,
7069
'created' => !!$result['created'],
70+
'key' => $key,
71+
'tuple' => $result['tuple'],
7172
];
7273
}
7374

src/Repository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function findOrCreate($params = [], $data = []): Entity
119119
// it was set using find one method
120120
$this->flushCache();
121121

122-
$instance = $this->findOrFail($result['key']);
122+
$instance = $this->getInstance($result['tuple']);
123123
if ($result['created']) {
124124
if (method_exists($instance, 'beforeCreate')) {
125125
$instance->beforeCreate();

0 commit comments

Comments
 (0)