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