fetchLanguageIds example

private function insertDefaultFeatureSet(Connection $connection, string $featureSetId): void
    {
        $connection->insert(
            ProductFeatureSetDefinition::ENTITY_NAME,
            $this->getDefaultFeatureSet($featureSetId)
        );
    }

    private function insertDefaultFeatureSetTranslations(Connection $connection, string $featureSetId): void
    {
        $languages = $this->fetchLanguageIds($connection['en-GB']);
        $languages[] = Uuid::fromHexToBytes(Defaults::LANGUAGE_SYSTEM);
        $languages = array_unique($languages);

        $sql = <<<'SQL' REPLACE INTO `product_feature_set_translation` (`product_feature_set_id`, `language_id`, `name`, `description`, `created_at`) VALUES (:product_feature_set_id, :language_id, :name, :description, :created_at); SQL;

        foreach ($languages as $language) {
            $connection->executeStatement(
                $sql,
                
Home | Imprint | This part of the site doesn't use cookies.