Skip to content

Commit 7cac14d

Browse files
committed
[Cache] Get TRUNCATE statement from platform
1 parent 75a6cbb commit 7cac14d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Symfony/Component/Cache/Adapter/DoctrineDbalAdapter.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,7 @@ protected function doHave(string $id): bool
213213
protected function doClear(string $namespace): bool
214214
{
215215
if ('' === $namespace) {
216-
if ('sqlite' === $this->getPlatformName()) {
217-
$sql = "DELETE FROM $this->table";
218-
} else {
219-
$sql = "TRUNCATE TABLE $this->table";
220-
}
216+
$sql = $this->conn->getDatabasePlatform()->getTruncateTableSQL($this->table);
221217
} else {
222218
$sql = "DELETE FROM $this->table WHERE $this->idCol LIKE '$namespace%'";
223219
}

0 commit comments

Comments
 (0)