hydrateProductImage example

->orderBy('image.main')
            ->addOrderBy('image.position')
            ->setParameter(':products', $ids, Connection::PARAM_INT_ARRAY);

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

        $result = [];
        foreach ($data as $row) {
            $productNumber = (string) $row['number'];
            $imageId = (int) $row['__image_id'];

            $result[$productNumber][$imageId] = $this->hydrator->hydrateProductImage($row);
        }

        return $result;
    }

    /** * {@inheritdoc} */
    public function getCovers($products, ShopContextInterface $context)
    {
        $ids = [];
        
->orderBy('image.main')
            ->addOrderBy('image.position')
            ->setParameter(':products', $ids, Connection::PARAM_INT_ARRAY);

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

        $result = [];
        foreach ($data as $row) {
            $productId = (int) $row['__image_articleID'];
            $imageId = (int) $row['__image_id'];

            $result[$productId][$imageId] = $this->hydrator->hydrateProductImage($row);
        }

        return $this->assignProductMedia($result$products);
    }

    /** * {@inheritdoc} */
    public function getCovers($products, ShopContextInterface $context)
    {
        $ids = [];
        
Home | Imprint | This part of the site doesn't use cookies.