Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
47 | 30 | public function beginTransaction() |
|
48 | { |
||
49 | 30 | if ($this->running) { |
|
50 | 3 | throw new BeginException('Transaction already running'); |
|
51 | } |
||
52 | |||
53 | 30 | if (count($this->items) === 0) { |
|
54 | 3 | throw new BeginException('No transaction to start'); |
|
55 | } |
||
56 | |||
57 | 27 | foreach ($this->items as $item) { |
|
58 | 27 | $item->beginTransaction(); |
|
59 | 27 | } |
|
60 | |||
61 | 27 | $this->running = true; |
|
62 | 27 | } |
|
63 | |||
112 |