Skip to content

Commit

Permalink
Address code review items
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Jan 19, 2024
1 parent 78166b7 commit 3323e50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/Doctrine/ODM/MongoDB/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -3183,6 +3183,9 @@ private function getTransactionOptions(array $options): array
/**
* This following method was taken from the MongoDB Library and adapted to not use the default 120 seconds timeout.
* The code within this method is licensed under the Apache License. Copyright belongs to MongoDB, Inc.
*
* @see https://github.com/mongodb/mongo-php-library/blob/1.17.0/src/Operation/WithTransaction.php
* @see https://github.com/mongodb/specifications/blob/master/source/transactions-convenient-api/transactions-convenient-api.rst#pseudo-code
*/
private function withTransaction(Session $session, callable $callback, array $transactionOptions = []): void
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Utility/LifecycleEventManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ public function preUpdate(ClassMetadata $class, object $document, ?Session $sess
return;
}

$eventArgs = new PreUpdateEventArgs($document, $this->dm, $this->uow->getDocumentChangeSet($document), $session);
if (! empty($class->lifecycleCallbacks[Events::preUpdate])) {
$eventArgs = new PreUpdateEventArgs($document, $this->dm, $this->uow->getDocumentChangeSet($document), $session);
$class->invokeLifecycleCallbacks(Events::preUpdate, $document, [$eventArgs]);
$this->uow->recomputeSingleDocumentChangeSet($class, $document);
}
Expand Down

0 comments on commit 3323e50

Please sign in to comment.