Skip to content

Commit 59232cd

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

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

Storage/DoctrineStorage.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,17 @@ 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+
62+
return;
63+
}
64+
65+
$this->keyColumn = $this->conn->quoteIdentifier(self::KEY_COLUMN);
66+
$this->valueColumn = $this->conn->quoteIdentifier(self::VALUE_COLUMN);
5867
}
5968

6069
/**

0 commit comments

Comments
 (0)