Skip to content

Instantly share code, notes, and snippets.

View taner-dll's full-sized avatar
🏠
Working from home

Taner Deliloglu taner-dll

🏠
Working from home
View GitHub Profile
@taner-dll
taner-dll / transaction.php
Last active December 16, 2019 03:02 — forked from datacow-com/transaction.php
Symfony 2 - Transaction
<?php
// Snippet for Symfony 2 application that uses Doctrine 2 to handle transactions
// It uses the names of the objects/doctrine repositories from the Beta 4 Manual of Symfony 2.
// Get the entity manager
$em = $this->getDoctrine()->getEntityManager();
// suspend auto-commit
$em->getConnection()->beginTransaction();