1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Damax\Common\Doctrine\Orm; |
||
6 | |||
7 | use Closure; |
||
8 | use Damax\Common\Domain\Transaction\TransactionManager as TransactionManagerInterface; |
||
9 | use Doctrine\ORM\EntityManagerInterface; |
||
10 | |||
11 | final class TransactionManager implements TransactionManagerInterface |
||
12 | { |
||
13 | private $em; |
||
14 | |||
15 | public function __construct(EntityManagerInterface $em) |
||
16 | { |
||
17 | $this->em = $em; |
||
18 | } |
||
19 | |||
20 | public function begin(): void |
||
21 | { |
||
22 | $this->em->beginTransaction(); |
||
23 | } |
||
24 | |||
25 | public function commit(): void |
||
26 | { |
||
27 | $this->em->commit(); |
||
28 | } |
||
29 | |||
30 | public function rollback(): void |
||
31 | { |
||
32 | $this->em->rollback(); |
||
33 | } |
||
34 | |||
35 | public function run(Closure $fn): void |
||
36 | { |
||
37 | $this->em->transactional($fn); |
||
0 ignored issues
–
show
|
|||
38 | } |
||
39 | } |
||
40 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.