Created
January 25, 2015 19:10
-
-
Save bakura10/851f6f3dac1bdc82462f to your computer and use it in GitHub Desktop.
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 | |
class UserController | |
{ | |
/** | |
* @var EntityManagerInterface | |
*/ | |
private $entityManager; | |
public function create() | |
{ | |
$user = ...; | |
$this->entityManager->transactional(function() { | |
$this->service1->create($user); | |
$this->service2->create($user); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@bakura10 when a transactional operation involves more than one table/entity?