Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $providerData = [['Partzilla', 'http://partzilla.com', 'USD', 9, null], ['Ronayers', 'http://ronayers.com', 'USD', 12, 19], ['Megazip', 'http://megazip.ru', 'RUB', 24, null]];
     foreach ($providerData as $providerDataItem) {
         list($providerName, $providerUrl, $providerCurrency, $providerDeliveryLeft, $providerDeliveryRight, ) = $providerDataItem;
         $provider = new Provider();
         $provider->setName($providerName);
         $provider->setUrl($providerUrl);
         $provider->setCurrency($providerCurrency);
         $provider->setDeliveryLeft($providerDeliveryLeft);
         $provider->setDeliveryRight($providerDeliveryRight);
         $manager->persist($provider);
         $this->addReference('provider-' . strtolower($providerName), $provider);
     }
     $manager->flush();
 }