transactionNestingLevel++; } public function rollBack(): void { parent::rollBack(); $this->transactionNestingLevel--; } public function commit(): void { parent::commit(); $this->transactionNestingLevel--; if ($this->transactionNestingLevel === 0) { $this->backgroundQueue->doPublishToBroker(); } } }