Bridge/Symfony/Serializer/Normalizer/SupplierProductNormalizer.php
public function normalize($product, $format = null, array $context = [])
    {
        $data = parent::normalize($product, $format, $context);

        if ($this->contextHasGroup(['Default', 'SupplierProduct', 'Search'], $context)) {
            $data = array_replace($data, [
                'designation' => $product->getDesignation(),
                'reference'   => $product->getReference(),
                'net_price'   => $product->getNetPrice(),
                'currency'    => $product->getSupplier()->getCurrency()->getCode(),
            ]);
        }

        return $data;
    }
public function normalize($product, $format = null, array $context = [])
    {
        $data = parent::normalize($product, $format, $context);

        if ($this->contextHasGroup(['Default', 'SupplierProduct', 'Search'], $context)) {
            $data = array_replace($data, [
                'designation' => $product->getDesignation(),
                'reference'   => $product->getReference(),
                'net_price'   => $product->getNetPrice(),
                'currency'    => $product->getSupplier()->getCurrency()->getCode(),
            ]);
        }

        return $data;
    }
@inheritdoc

@param SupplierProductInterface $product