Skip to content

Commit

Permalink
removed PersistenceInterface::transactional
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubkulhan committed May 29, 2024
1 parent cf9027f commit 538844e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
5 changes: 0 additions & 5 deletions data-access-kit-symfony/test/Fixture/DummyPersistence.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ public function deleteAll(array $objects): void
throw new LogicException("Not implemented");
}

public function transactional(callable $callback): mixed
{
throw new LogicException("Not implemented");
}

public function toRow(object $object): array
{
throw new LogicException("Not implemented");
Expand Down
13 changes: 0 additions & 13 deletions data-access-kit/src/Persistence.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,6 @@ public function deleteAll(array $objects): void
);
}

public function transactional(callable $callback): mixed
{
try {
$this->connection->beginTransaction();
$result = $callback();
$this->connection->commit();
return $result;
} catch (\Throwable $e) {
$this->connection->rollBack();
throw $e;
}
}

public function toRow(object $object): array
{
$table = $this->registry->get($object);
Expand Down
9 changes: 0 additions & 9 deletions data-access-kit/src/PersistenceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,6 @@ public function delete(object $object): void;
*/
public function deleteAll(array $objects): void;

/**
* Run $callback in a transaction.
*
* @template T
* @param callable(): T $callback
* @return T
*/
public function transactional(callable $callback): mixed;

/**
* Convert $object to an associative array.
*
Expand Down

0 comments on commit 538844e

Please sign in to comment.