Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/contracts/Test/Persistence/Fixture/FixtureImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private function truncateTables(array $tables): void
try {
// Cleanup before inserting (using TRUNCATE for speed, however not possible to rollback)
$this->connection->executeStatement(
$dbPlatform->getTruncateTableSql($this->connection->quoteIdentifier($table))
$dbPlatform->getTruncateTableSql($this->connection->quoteSingleIdentifier($table))
);
} catch (DBALException) {
// Fallback to DELETE if TRUNCATE failed (because of FKs for instance)
Expand Down Expand Up @@ -130,8 +130,8 @@ private function getSequenceResetStatements(array $affectedTables): iterable
self::$resetSequenceStatements[$tableName] = sprintf(
$queryTemplate,
$sequenceName,
sprintf('MAX(%s)', $this->connection->quoteIdentifier($columnName)),
$this->connection->quoteIdentifier($tableName)
sprintf('MAX(%s)', $this->connection->quoteSingleIdentifier($columnName)),
$this->connection->quoteSingleIdentifier($tableName)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ protected function getPropertyMapping()
protected function setFetchColumns(QueryBuilder $queryBuilder, $fieldId, $versionNo)
{
$queryBuilder->select(
$this->connection->quoteIdentifier('filename'),
$this->connection->quoteIdentifier('mime_type'),
$this->connection->quoteIdentifier('original_filename')
$this->connection->quoteSingleIdentifier('filename'),
$this->connection->quoteSingleIdentifier('mime_type'),
$this->connection->quoteSingleIdentifier('original_filename')
);
}

Expand Down Expand Up @@ -155,19 +155,19 @@ protected function updateFieldData(VersionInfo $versionInfo, Field $field)
{
$updateQuery = $this->connection->createQueryBuilder();
$updateQuery->update(
$this->connection->quoteIdentifier($this->getStorageTable())
$this->connection->quoteSingleIdentifier($this->getStorageTable())
);

$this->setUpdateColumns($updateQuery, $versionInfo, $field);
$updateQuery
->where(
$updateQuery->expr()->and(
$updateQuery->expr()->eq(
$this->connection->quoteIdentifier('contentobject_attribute_id'),
$this->connection->quoteSingleIdentifier('contentobject_attribute_id'),
':fieldId'
),
$updateQuery->expr()->eq(
$this->connection->quoteIdentifier('version'),
$this->connection->quoteSingleIdentifier('version'),
':versionNo'
)
)
Expand All @@ -187,7 +187,7 @@ protected function storeNewFieldData(VersionInfo $versionInfo, Field $field)
{
$insertQuery = $this->connection->createQueryBuilder();
$insertQuery->insert(
$this->connection->quoteIdentifier($this->getStorageTable())
$this->connection->quoteSingleIdentifier($this->getStorageTable())
);

$this->setInsertColumns($insertQuery, $versionInfo, $field);
Expand Down Expand Up @@ -224,15 +224,15 @@ public function getFileReferenceData($fieldId, $versionNo)
$this->setFetchColumns($selectQuery, $fieldId, $versionNo);

$selectQuery
->from($this->connection->quoteIdentifier($this->getStorageTable()))
->from($this->connection->quoteSingleIdentifier($this->getStorageTable()))
->where(
$selectQuery->expr()->and(
$selectQuery->expr()->eq(
$this->connection->quoteIdentifier('contentobject_attribute_id'),
$this->connection->quoteSingleIdentifier('contentobject_attribute_id'),
':fieldId'
),
$selectQuery->expr()->eq(
$this->connection->quoteIdentifier('version'),
$this->connection->quoteSingleIdentifier('version'),
':versionNo'
)
)
Expand Down Expand Up @@ -320,15 +320,15 @@ public function removeFileReferences(array $fieldIds, $versionNo)

$deleteQuery = $this->connection->createQueryBuilder();
$deleteQuery
->delete($this->connection->quoteIdentifier($this->getStorageTable()))
->delete($this->connection->quoteSingleIdentifier($this->getStorageTable()))
->where(
$deleteQuery->expr()->and(
$deleteQuery->expr()->in(
$this->connection->quoteIdentifier('contentobject_attribute_id'),
$this->connection->quoteSingleIdentifier('contentobject_attribute_id'),
':fieldIds'
),
$deleteQuery->expr()->eq(
$this->connection->quoteIdentifier('version'),
$this->connection->quoteSingleIdentifier('version'),
':versionNo'
)
)
Expand All @@ -350,15 +350,15 @@ public function removeFileReference($fieldId, $versionNo)
{
$deleteQuery = $this->connection->createQueryBuilder();
$deleteQuery
->delete($this->connection->quoteIdentifier($this->getStorageTable()))
->delete($this->connection->quoteSingleIdentifier($this->getStorageTable()))
->where(
$deleteQuery->expr()->and(
$deleteQuery->expr()->eq(
$this->connection->quoteIdentifier('contentobject_attribute_id'),
$this->connection->quoteSingleIdentifier('contentobject_attribute_id'),
':fieldId'
),
$deleteQuery->expr()->eq(
$this->connection->quoteIdentifier('version'),
$this->connection->quoteSingleIdentifier('version'),
':versionNo'
)
)
Expand Down Expand Up @@ -386,18 +386,18 @@ public function getReferencedFiles(array $fieldIds, $versionNo)
$selectQuery = $this->connection->createQueryBuilder();
$selectQuery
->select(
$this->connection->quoteIdentifier('filename'),
$this->connection->quoteIdentifier('mime_type')
$this->connection->quoteSingleIdentifier('filename'),
$this->connection->quoteSingleIdentifier('mime_type')
)
->from($this->connection->quoteIdentifier($this->getStorageTable()))
->from($this->connection->quoteSingleIdentifier($this->getStorageTable()))
->where(
$selectQuery->expr()->and(
$selectQuery->expr()->in(
$this->connection->quoteIdentifier('contentobject_attribute_id'),
$this->connection->quoteSingleIdentifier('contentobject_attribute_id'),
':fieldIds'
),
$selectQuery->expr()->eq(
$this->connection->quoteIdentifier('version'),
$this->connection->quoteSingleIdentifier('version'),
':versionNo'
)
)
Expand Down Expand Up @@ -432,23 +432,23 @@ public function countFileReferences(array $files)
$selectQuery = $this->connection->createQueryBuilder();
$selectQuery
->select(
$this->connection->quoteIdentifier('filename'),
$this->connection->quoteIdentifier('mime_type'),
$this->connection->quoteSingleIdentifier('filename'),
$this->connection->quoteSingleIdentifier('mime_type'),
sprintf(
'COUNT(%s) AS count',
$this->connection->quoteIdentifier('contentobject_attribute_id')
$this->connection->quoteSingleIdentifier('contentobject_attribute_id')
)
)
->from($this->connection->quoteIdentifier($this->getStorageTable()))
->from($this->connection->quoteSingleIdentifier($this->getStorageTable()))
->where(
$selectQuery->expr()->in(
$this->connection->quoteIdentifier('filename'),
$this->connection->quoteSingleIdentifier('filename'),
':filenames'
)
)
->groupBy(
$this->connection->quoteIdentifier('filename'),
$this->connection->quoteIdentifier('mime_type')
$this->connection->quoteSingleIdentifier('filename'),
$this->connection->quoteSingleIdentifier('mime_type')
)
->setParameter(
'filenames',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function setFetchColumns(QueryBuilder $queryBuilder, $fieldId, $versio
parent::setFetchColumns($queryBuilder, $fieldId, $versionNo);

$queryBuilder->addSelect(
$this->connection->quoteIdentifier('download_count')
$this->connection->quoteSingleIdentifier('download_count')
);
}

Expand Down
Loading
Loading