Skip to content
Permalink
Browse files

Fix #12163

  • Loading branch information...
Joep Roebroek
Joep Roebroek committed May 31, 2018
1 parent cfaa31c commit 39e89f3a39b280f83bd5a10bb2f6344be1a013bc
Showing with 4 additions and 4 deletions.
  1. +3 −3 src/ORM/Table.php
  2. +1 −1 tests/TestCase/ORM/TableTest.php
@@ -1675,13 +1675,13 @@ protected function _transactionCommitted($atomic, $primary)
*/
public function findOrCreate($search, callable $callback = null, $options = [])
{
$options += [
$options = new ArrayObject($options + [
'atomic' => true,
'defaults' => true,
];
]);
$entity = $this->_executeTransaction(function () use ($search, $callback, $options) {
return $this->_processFindOrCreate($search, $callback, $options);
return $this->_processFindOrCreate($search, $callback, $options->getArrayCopy());
}, $options['atomic']);
if ($entity && $this->_transactionCommitted($options['atomic'], true)) {
@@ -6150,7 +6150,7 @@ public function testFindOrCreateNoDefaults()
public function testFindOrCreateTransactions()
{
$articles = $this->getTableLocator()->get('Articles');
$articles->getEventManager()->on('Model.afterSaveCommit', function ($event, $entity) {
$articles->getEventManager()->on('Model.afterSaveCommit', function (Event $event, EntityInterface $entity, ArrayObject $options) {
$entity->afterSaveCommit = true;
});

0 comments on commit 39e89f3

Please sign in to comment.
You can’t perform that action at this time.