diff --git a/src/Translatable/Entity/Repository/TranslationRepository.php b/src/Translatable/Entity/Repository/TranslationRepository.php index f0ac501019..b10044cc7a 100644 --- a/src/Translatable/Entity/Repository/TranslationRepository.php +++ b/src/Translatable/Entity/Repository/TranslationRepository.php @@ -149,10 +149,8 @@ public function findTranslations($entity) ->from($translationClass, 'trans') ->where('trans.foreignKey = :entityId', 'trans.objectClass = :entityClass') ->orderBy('trans.locale') - ->setParameters([ - 'entityId' => $entityId, - 'entityClass' => $entityClass, - ]); + ->setParameter('entityId', $entityId) + ->setParameter('entityClass', $entityClass); foreach ($qb->getQuery()->toIterable([], Query::HYDRATE_ARRAY) as $row) { $result[$row['locale']][$row['field']] = $row['content']; diff --git a/src/Translatable/Mapping/Event/Adapter/ORM.php b/src/Translatable/Mapping/Event/Adapter/ORM.php index e763caa926..e6765a106c 100644 --- a/src/Translatable/Mapping/Event/Adapter/ORM.php +++ b/src/Translatable/Mapping/Event/Adapter/ORM.php @@ -142,11 +142,10 @@ public function findTranslation(AbstractWrapper $wrapped, $locale, $field, $tran 'trans.locale = :locale', 'trans.field = :field' ) + ->setParameter('locale', $locale) + ->setParameter('field', $field) ; - $qb->setParameters([ - 'locale' => $locale, - 'field' => $field, - ]); + if ($this->usesPersonalTranslation($translationClass)) { $qb->andWhere('trans.object = :object'); if ($wrapped->getIdentifier()) { diff --git a/src/Tree/Strategy/ORM/Nested.php b/src/Tree/Strategy/ORM/Nested.php index 9e192d5956..7110242e4c 100644 --- a/src/Tree/Strategy/ORM/Nested.php +++ b/src/Tree/Strategy/ORM/Nested.php @@ -215,7 +215,8 @@ public function processScheduledDelete($em, $node) $qb->select('node') ->from($config['useObjectClass'], 'node') ->where($qb->expr()->between('node.'.$config['left'], '?1', '?2')) - ->setParameters([1 => $leftValue, 2 => $rightValue]); + ->setParameter(1, $leftValue) + ->setParameter(2, $rightValue); if (isset($config['root'])) { $qb->andWhere($qb->expr()->eq('node.'.$config['root'], ':rid'));