Skip to content

Commit

Permalink
Merge pull request #5 from PcComponentes/feature/NestTransactionsWith…
Browse files Browse the repository at this point in the history
…Savepoints

feat: NestTransactionsWithSavepoints argument
  • Loading branch information
zoilomora authored Jun 10, 2024
2 parents 2d1331f + ce47c06 commit 51311b6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apk add --no-cache \
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer

RUN apk add --no-cache --virtual .phpize_deps $PHPIZE_DEPS && \
pecl install xdebug 3 && \
pecl install xdebug-3.1.1 && \
docker-php-ext-enable xdebug && \
rm -rf /usr/share/php7 && \
rm -rf /tmp/pear && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ logs:

.PHONY: tests
tests:
docker-compose run --rm -u ${UID}:${GID} ${DOCKER_PHP_SERVICE} phpunit
docker-compose run --rm -u ${UID}:${GID} ${DOCKER_PHP_SERVICE} phpunit
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@
"pccomponentes/coding-standard": "^1.0",
"phpunit/phpunit": "^9",
"dg/bypass-finals": "^1.1"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.7'
services:
php:
build: .
Expand Down
6 changes: 5 additions & 1 deletion src/Driver/DBAL/DBALTransactionalConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ final class DBALTransactionalConnection implements TransactionalConnection
{
private Connection $DBALConnection;

public function __construct(Connection $DBALConnection)
public function __construct(Connection $DBALConnection, bool $nestTransactionsWithSavepoints = false)
{
$this->DBALConnection = $DBALConnection;

if (true === $nestTransactionsWithSavepoints) {
$this->DBALConnection->setNestTransactionsWithSavepoints(true);
}
}

public function beginTransaction(): void
Expand Down

0 comments on commit 51311b6

Please sign in to comment.