Skip to content

Commit 9e9e3ae

Browse files
Switch from PDO types to Doctrine types
1 parent bbccc03 commit 9e9e3ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

EventSubscriber/LogHistorySubscriber.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Doctrine\DBAL\Connection;
88
use Doctrine\DBAL\Platforms\AbstractPlatform;
99
use Doctrine\DBAL\Types\Type;
10+
use Doctrine\DBAL\Types\Types;
1011
use Doctrine\ORM\EntityManager;
1112
use Doctrine\ORM\Event\OnFlushEventArgs;
1213
use Doctrine\ORM\Event\PostPersistEventArgs;
@@ -15,7 +16,6 @@
1516
use Doctrine\ORM\UnitOfWork;
1617
use Doctrine\ORM\Utility\PersisterHelper;
1718
use LogicException;
18-
use PDO;
1919

2020
/**
2121
* Based on the work of
@@ -210,7 +210,7 @@ private function getRevisionId(ClassMetadata $class, $entityData, $revType): int
210210

211211
private function saveRevisionEntityData(ClassMetadata $class, array $entityData, string $revType): void {
212212
$params = [$this->getRevisionId($class, $entityData, $revType), $revType];
213-
$types = [PDO::PARAM_INT, PDO::PARAM_STR];
213+
$types = [Types::INTEGER, Types::STRING];
214214

215215
$fields = [];
216216

@@ -228,7 +228,7 @@ private function saveRevisionEntityData(ClassMetadata $class, array $entityData,
228228
$fields[$sourceColumn] = true;
229229
if ($entityData[$field] === NULL) {
230230
$params[] = NULL;
231-
$types[] = PDO::PARAM_STR;
231+
$types[] = Types::STRING;
232232
} else {
233233
$params[] = $relatedId[$targetClass->fieldNames[$targetColumn]];
234234
$types[] = PersisterHelper::getTypeOfColumn($targetColumn, $targetClass, $this->em);

0 commit comments

Comments
 (0)