/**
  * @param ProductAssociationInterface $productAssociation
  * @param string $productIds
  */
 private function setAssociatedProductsByProductIds(ProductAssociationInterface $productAssociation, $productIds)
 {
     $products = $this->productRepository->findBy(['id' => explode(',', $productIds)]);
     $productAssociation->clearAssociatedProducts();
     foreach ($products as $product) {
         $productAssociation->addAssociatedProduct($product);
     }
 }
 /**
  * @param array $ids
  *
  * @return array
  */
 public function getProductsByIds(array $ids)
 {
     return $this->productRepository->findBy(['id' => $ids]);
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('product_code', 'sylius_product_from_identifier', ['label' => 'sylius.form.promotion_action.add_product_configuration.product', 'class' => $this->productRepository->getClassName(), 'constraints' => [new NotBlank(), new Type(['type' => 'string'])], 'identifier' => 'code']);
 }