| Total Complexity | 4 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | trait BakeryTransactionalAware |
||
| 9 | { |
||
| 10 | protected $inTransaction = false; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Fire the given event for the model. |
||
| 14 | * |
||
| 15 | * @param string $event |
||
| 16 | * @param bool $halt |
||
| 17 | * @return mixed |
||
| 18 | */ |
||
| 19 | abstract protected function fireModelEvent($event, $halt = true); |
||
| 20 | |||
| 21 | /** |
||
| 22 | * The "booting" method of the Bakery events trait. |
||
| 23 | * |
||
| 24 | * @return void |
||
| 25 | */ |
||
| 26 | public static function bootBakeryTransactionalAware() |
||
| 30 | }); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Start the transaction for this model. |
||
| 35 | * |
||
| 36 | * @return void |
||
| 37 | */ |
||
| 38 | public function startTransaction() |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * End the transaction for this model. |
||
| 46 | * |
||
| 47 | * @return void |
||
| 48 | */ |
||
| 49 | public function endTransaction() |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Return if the model is currently in transaction. |
||
| 57 | * |
||
| 58 | * @return bool |
||
| 59 | */ |
||
| 60 | public function inTransaction(): bool |
||
| 65 |