public function findDataByTypesAndNames(string $locale, array $namesByTypes, array $modCombinationIds = []): array
    {
        $columns = [
            't.locale AS locale',
            't.type AS type',
            't.name AS name',
            't.value AS value',
            't.description AS description',
            't.isDuplicatedByRecipe AS isDuplicatedByRecipe',
            't.isDuplicatedByMachine AS isDuplicatedByMachine',
            'mc.order AS order'
        ];

        $queryBuilder = $this->entityManager->createQueryBuilder();
        $queryBuilder->select($columns)
                     ->from(Translation::class, 't')
                     ->innerJoin('t.modCombination', 'mc')
                     ->andWhere('t.locale IN (:locales)')
                     ->setParameter('locales', [$locale, 'en']);

        $conditions = [];
        foreach ($namesByTypes as $type => $names) {
            if (count($names) > 0) {
                $index = count($conditions);
                switch ($type) {
                    case TranslationType::RECIPE:
                        // Special case: Recipes may re-use the translations provided by the item with the same name.
                        $conditions[] = '((t.type = :type' . $index . ' OR t.isDuplicatedByRecipe = 1) '
                            . 'AND t.name IN (:names' . $index . '))';
                        break;

                    case TranslationType::MACHINE:
                        // Special case: Machines may re-use the translations provided by the item with the same name.
                        $conditions[] = '((t.type = :type' . $index . ' OR t.isDuplicatedByMachine = 1) '
                            . 'AND t.name IN (:names' . $index . '))';
                        break;

                    default:
                        $conditions[] = '(t.type = :type' . $index . ' AND t.name IN (:names' . $index . '))';
                        break;
                }
                $queryBuilder->setParameter('type' . $index, $type)
                             ->setParameter('names' . $index, array_values($names));
            }
        }

        $result = [];
        if (count($conditions) > 0) {
            $queryBuilder->andWhere('(' . implode(' OR ', $conditions) . ')');

            if (count($modCombinationIds) > 0) {
                $queryBuilder->andWhere('(t.modCombination IN (:modCombinationIds) OR t.type = :typeMod)')
                             ->setParameter('modCombinationIds', array_values($modCombinationIds))
                             ->setParameter('typeMod', 'mod');
            }

            $result = $this->mapTranslationDataResult($queryBuilder->getQuery()->getResult());
        }
        return $result;
    }