public function commit() { if (!$this->inTransaction) { throw new LogicException('No transaction to commit.'); } $this->objectManager->commitTransaction(); $this->inTransaction = false; }