addPropertySetTranslation example

->innerJoin('propertyOption', 's_filter_options', 'propertyGroup', 'propertyGroup.id = propertyOption.optionID AND relations.optionID = propertyGroup.id')
            ->leftJoin('propertyOption', 's_media', 'media', 'propertyOption.media_id = media.id')
            ->leftJoin('propertySet', 's_filter_attributes', 'propertySetAttribute', 'propertySetAttribute.filterID = propertySet.id')
            ->leftJoin('propertyGroup', 's_filter_options_attributes', 'propertyGroupAttribute', 'propertyGroupAttribute.optionID = propertyGroup.id')
            ->leftJoin('propertyOption', 's_filter_values_attributes', 'propertyOptionAttribute', 'propertyOptionAttribute.valueID = propertyOption.id')
            ->leftJoin('media', 's_media_attributes', 'mediaAttribute', 'mediaAttribute.mediaID = media.id')
            ->leftJoin('media', 's_media_album_settings', 'mediaSettings', 'mediaSettings.albumID = media.albumID')
            ->where('products.id IN (:ids)')
            ->setParameter(':ids', $ids, Connection::PARAM_INT_ARRAY)
            ->orderBy('filterArticles.articleID');

        $this->fieldHelper->addPropertySetTranslation($query$context);
        $this->fieldHelper->addPropertyGroupTranslation($query$context);
        $this->fieldHelper->addPropertyOptionTranslation($query$context);
        $this->fieldHelper->addMediaTranslation($query$context);

        $data = $query->execute()->fetchAll(PDO::FETCH_GROUP);

        $properties = [];
        foreach ($data as $productId => $values) {
            $properties[$productId] = $this->propertyHydrator->hydrateValues($values);
        }

        
->where('propertyOption.id IN (:ids)')
            ->groupBy('propertyOption.id')
            ->orderBy('propertySet.position')
            ->setParameter(':ids', $valueIds, Connection::PARAM_INT_ARRAY);

        if ($filterGroupIds) {
            $query->andWhere('propertySet.id IN (:filterSetIds)')
                ->setParameter(':filterSetIds', $filterGroupIds, Connection::PARAM_INT_ARRAY);
        }

        $this->fieldHelper->addMediaTranslation($query$context);
        $this->fieldHelper->addPropertySetTranslation($query$context);
        $this->fieldHelper->addPropertyGroupTranslation($query$context);
        $this->fieldHelper->addPropertyOptionTranslation($query$context);

        $rows = $query->execute()->fetchAll(PDO::FETCH_ASSOC);

        return $this->propertyHydrator->hydrateValues($rows);
    }
}
Home | Imprint | This part of the site doesn't use cookies.