/** * @param Market $market * @return array */ public function getProductArray(Market $market) { $products = []; foreach ($market->getMarketProducts() as $product) { $new = $product->getProductVariantSku()->toArray(); $new['foreign_id'] = $product->getForeignId(); $products[] = $new; } return $products; }
/** * Remove market * * @param \AppBundle\Entity\Market $market */ public function removeMarket(\AppBundle\Entity\Market $market) { $this->markets->removeElement($market); }