Created
January 20, 2015 12:59
-
-
Save Ocramius/031fda1612b30ae6f255 to your computer and use it in GitHub Desktop.
Multiple nested Doctrine2 EntityManager transactions pseudo-code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use doctrine\ORM\EntityManagerInterface; | |
$entityManager->transactional(function (EntityManagerInterface $entityManager) { | |
// first transaction | |
$entityManager->transactional(function () { | |
// nested transaction #1 | |
}); | |
$entityManager->transactional(function () { | |
// nested transaction #2 | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment