Skip to content

Instantly share code, notes, and snippets.

@bakura10
Created January 25, 2015 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bakura10/851f6f3dac1bdc82462f to your computer and use it in GitHub Desktop.
Save bakura10/851f6f3dac1bdc82462f to your computer and use it in GitHub Desktop.
<?php
class UserController
{
/**
* @var EntityManagerInterface
*/
private $entityManager;
public function create()
{
$user = ...;
$this->entityManager->transactional(function() {
$this->service1->create($user);
$this->service2->create($user);
});
}
}
@stefanorg
Copy link

@bakura10 when a transactional operation involves more than one table/entity?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment