Skip to content

Commit 755c0a6

Browse files
committed
Use method Connection::quoteSingleIdentifier() only if it exists
1 parent 1eac04d commit 755c0a6

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Storage/DoctrineStorage.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,15 @@ public function __construct(Connection $conn, StorageKeyGeneratorInterface $stor
5353
$this->storageKeyGenerator = $storageKeyGenerator;
5454
// TODO just call `createSchemaManager()` as soon as DBAL >= 3.1 is required
5555
$this->schemaManager = \method_exists($this->conn, 'createSchemaManager') ? $this->conn->createSchemaManager() : $this->conn->getSchemaManager();
56-
$this->keyColumn = $this->conn->quoteSingleIdentifier(self::KEY_COLUMN);
57-
$this->valueColumn = $this->conn->quoteSingleIdentifier(self::VALUE_COLUMN);
56+
57+
// BC for doctrine/dbal < 4
58+
if(method_exists($this->conn, 'quoteSingleIdentifier')) {
59+
$this->keyColumn = $this->conn->quoteSingleIdentifier(self::KEY_COLUMN);
60+
$this->valueColumn = $this->conn->quoteSingleIdentifier(self::VALUE_COLUMN);
61+
} else {
62+
$this->keyColumn = $this->conn->quoteIdentifier(self::KEY_COLUMN);
63+
$this->valueColumn = $this->conn->quoteIdentifier(self::VALUE_COLUMN);
64+
}
5865
}
5966

6067
/**

0 commit comments

Comments
 (0)