|
@@ -1675,13 +1675,13 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
|
|
|
*/
|
|
*/
|
|
|
public function findOrCreate($search, callable $callback = null, $options = [])
|
|
public function findOrCreate($search, callable $callback = null, $options = [])
|
|
|
{
|
|
{
|
|
|
- $options += [
|
|
|
|
|
|
|
+ $options = new ArrayObject($options + [
|
|
|
'atomic' => true,
|
|
'atomic' => true,
|
|
|
'defaults' => true,
|
|
'defaults' => true,
|
|
|
- ];
|
|
|
|
|
|
|
+ ]);
|
|
|
|
|
|
|
|
$entity = $this->_executeTransaction(function () use ($search, $callback, $options) {
|
|
$entity = $this->_executeTransaction(function () use ($search, $callback, $options) {
|
|
|
- return $this->_processFindOrCreate($search, $callback, $options);
|
|
|
|
|
|
|
+ return $this->_processFindOrCreate($search, $callback, $options->getArrayCopy());
|
|
|
}, $options['atomic']);
|
|
}, $options['atomic']);
|
|
|
|
|
|
|
|
if ($entity && $this->_transactionCommitted($options['atomic'], true)) {
|
|
if ($entity && $this->_transactionCommitted($options['atomic'], true)) {
|