Conditions | 3 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
50 | public function beginDatabaseTransaction() |
||
51 | { |
||
52 | $database = $this->app->make('db'); |
||
53 | |||
54 | foreach ($this->connectionsToTransact() as $name) { |
||
55 | $database->connection($name)->beginTransaction(); |
||
56 | } |
||
57 | |||
58 | $this->beforeApplicationDestroyed(function () use ($database) { |
||
59 | foreach ($this->connectionsToTransact() as $name) { |
||
60 | $database->connection($name)->rollBack(); |
||
61 | } |
||
62 | }); |
||
63 | } |
||
64 | |||
76 |
If you suppress an error, we recommend checking for the error condition explicitly: