Skip to content

Commit a132276

Browse files
committed
remove convertFieldValuesToDatabaseValues()
1 parent a3082e4 commit a132276

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

src/EntityPreloader.php

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ private function preloadManyToManyInner(
331331
->andWhere('source IN (:sourceEntityIds)')
332332
->setParameter(
333333
'sourceEntityIds',
334-
$this->convertFieldValuesToDatabaseValues($sourceIdentifierType, $uninitializedSourceEntityIdsChunk),
334+
$uninitializedSourceEntityIdsChunk,
335335
$this->deduceArrayParameterType($sourceIdentifierType),
336336
)
337337
->getQuery()
@@ -444,7 +444,7 @@ private function loadEntitiesBy(
444444
->andWhere("{$rootLevelAlias}.{$fieldName} IN (:fieldValues)")
445445
->setParameter(
446446
'fieldValues',
447-
$this->convertFieldValuesToDatabaseValues($referencedType, $fieldValues),
447+
$fieldValues,
448448
$this->deduceArrayParameterType($referencedType),
449449
);
450450

@@ -468,26 +468,6 @@ private function deduceArrayParameterType(Type $dbalType): ArrayParameterType|in
468468
};
469469
}
470470

471-
/**
472-
* @param array<mixed> $fieldValues
473-
* @return list<mixed>
474-
*/
475-
private function convertFieldValuesToDatabaseValues(
476-
Type $dbalType,
477-
array $fieldValues,
478-
): array
479-
{
480-
$connection = $this->entityManager->getConnection();
481-
$platform = $connection->getDatabasePlatform();
482-
483-
$convertedValues = [];
484-
foreach ($fieldValues as $value) {
485-
$convertedValues[] = $dbalType->convertToDatabaseValue($value, $platform);
486-
}
487-
488-
return $convertedValues;
489-
}
490-
491471
/**
492472
* @param ClassMetadata<C> $classMetadata
493473
*

0 commit comments

Comments
 (0)