Пример #1
0
 /**
  * Adds taxons to given product.
  *
  * @param ProductInterface $product
  * @param array            $taxonNames
  */
 protected function setTaxons(ProductInterface $product, array $taxonNames)
 {
     $taxons = new ArrayCollection();
     foreach ($taxonNames as $taxonName) {
         $taxons->add($this->getReference('Sylius.Taxon.' . $taxonName));
     }
     $product->setTaxons($taxons);
 }