symfony2でエンティティマネージャ(doctrine)とのトランザクションを手動で指定する方法はありますか?また、1つのトランザクションで自然に達成する方法は2つありますか?トランザクションとsymfony2エンティティマネージャ
// creating screen object...
//Creating user object...
//flush the screen into database in order to get the Id to relate the server (user) to
$em->persist($screen);
$em->flush();
//Get id of just inserted screen and attach that to new server (user)
$tempRecordId = $screen->getId();
$tempEntity = $em->getRepository('BizTVContainerManagementBundle:Container')->find($tempRecordId);
$entity->setScreen($tempEntity);
//Flush the user also into database
$em->persist($entity);
$em->flush();
私はそれがIDアウトですので、私は私の最初に私の第二のエンティティを関連付けることができます得るために私の最初のエンティティをフラッシュする必要があります見る
これは簡単なことではありませんでした!私はそれがハァッとする必要があるよりも複雑にしていたと思います! –