/** * @param ObjectManager $manager */ public function load(ObjectManager $manager) { $media1 = new Media(); $media1->setPath('http://www.lakaz-piment.com/piment.jpg'); $media1->setAlt('Legumes'); $manager->persist($media1); $media2 = new Media(); $media2->setPath('http://www.lakaz-piment.com/piment.jpg'); $media2->setAlt('Fruits'); $manager->persist($media2); $media3 = new Media(); $media3->setPath('http://www.lakaz-piment.com/piment.jpg'); $media3->setAlt('Poivron vert'); $manager->persist($media3); $media4 = new Media(); $media4->setPath('http://www.lakaz-piment.com/piment.jpg'); $media4->setAlt('Piment'); $manager->persist($media4); $media5 = new Media(); $media5->setPath('http://www.lakaz-piment.com/piment.jpg'); $media5->setAlt('Tomate'); $manager->persist($media5); $manager->flush(); $this->addReference('Media1', $media1); $this->addReference('Media2', $media2); $this->addReference('Media3', $media3); $this->addReference('Media4', $media4); $this->addReference('Media5', $media5); }
/** * {@inheritDoc} */ public function load(ObjectManager $manager) { $media1 = new Media(); $media1->setAlt('pomme'); $media1->setPath('http://image.shutterstock.com/display_pic_with_logo/353191/124592107/stock-photo-red-apple-with-leaf-124592107.jpg'); $manager->persist($media1); //$manager->flush(); $media2 = new Media(); $media2->setAlt('oignon'); $media2->setPath('http://image.shutterstock.com/display_pic_with_logo/999701/123228298/stock-photo-ripe-onion-on-a-white-background-123228298.jpg'); $manager->persist($media2); //$manager->flush(); $media3 = new Media(); $media3->setAlt('legume'); $media3->setPath('https://commons.wikimedia.org/wiki/File:13-08-06-abu-dhabi-marina-mall-57.jpg'); $manager->persist($media3); //$manager->flush(); $media4 = new Media(); $media4->setAlt('Piment'); $media4->setPath('https://commons.wikimedia.org/wiki/File:Piments_lampions.jpg'); $manager->persist($media4); //$manager->flush(); $media5 = new Media(); $media5->setAlt('raisin'); $media5->setPath('http://images.all-free-download.com/images/graphiclarge/grape_hd_picture_5_167243.jpg'); $manager->persist($media5); //$manager->flush(); $media6 = new Media(); $media6->setAlt('poivron'); $media6->setPath('http://image.shutterstock.com/display_pic_with_logo/683470/99858464/stock-photo-bell-pepper-mix-on-white-background-99858464.jpg'); $manager->persist($media6); //$manager->flush(); $media7 = new Media(); $media7->setAlt('tomate'); $media7->setPath('http://image.shutterstock.com/display_pic_with_logo/359716/129610550/stock-photo-tomato-with-drops-isolated-129610550.jpg'); $manager->persist($media7); $media8 = new Media(); $media8->setAlt('aubergine'); $media8->setPath('http://image.shutterstock.com/display_pic_with_logo/676765/151789964/stock-photo-eggplant-or-aubergine-vegetable-on-white-background-151789964.jpg'); $manager->persist($media8); $media9 = new Media(); $media9->setAlt('orange'); $media9->setPath('http://images.all-free-download.com/images/graphiclarge/orange_191422.jpg'); $manager->persist($media9); $manager->flush(); $this->addReference('media1', $media1); $this->addReference('media2', $media2); $this->addReference('media3', $media3); $this->addReference('media4', $media4); $this->addReference('media5', $media5); $this->addReference('media6', $media6); $this->addReference('media7', $media7); $this->addReference('media8', $media8); $this->addReference('media9', $media9); }
public function load(ObjectManager $manager) { $tab_Medias = array(array("nom" => "tomate", "description" => "image tomate", "path" => "bundles/ecommerceecommerce/images/tomate.jpg"), array("nom" => "banane", "description" => "image banane", "path" => "bundles/ecommerceecommerce/images/banane.png"), array("nom" => "carotte", "description" => "image carotte", "path" => "bundles/ecommerceecommerce/images/carotte.jpg"), array("nom" => "poire", "description" => "image poire", "path" => "bundles/ecommerceecommerce/images/poire.jpg"), array("nom" => "poirreau", "description" => "image poirreau", "path" => "bundles/ecommerceecommerce/images/poirreau.jpg"), array("nom" => "pomme", "description" => "image pomme", "path" => "bundles/ecommerceecommerce/images/pomme.jpg"), array("nom" => "salade", "description" => "image salade", "path" => "bundles/ecommerceecommerce/images/salade.jpg"), array("nom" => "fruit", "description" => "image fruit", "path" => "bundles/ecommerceecommerce/images/fruit.jpg"), array("nom" => "legume", "description" => "image legume", "path" => "bundles/ecommerceecommerce/images/legume.jpg"), array("nom" => "user", "description" => "image user", "path" => "bundles/ecommerceecommerce/images/user.png")); for ($i = 0; $i < sizeof($tab_Medias); $i++) { $image = new Media(); $image->setNom($tab_Medias[$i]['nom']); $image->setDescription($tab_Medias[$i]['description']); $image->setPath($tab_Medias[$i]['path']); $manager->persist($image); } $manager->flush(); }
public function load(ObjectManager $manager) { $media1 = new Media(); $media1->setAlt('Vegetable'); $media1->setPath('http://lorempixel.com/400/200/food/5/'); $manager->persist($media1); $media2 = new Media(); $media2->setAlt('Fruit'); $media2->setPath('http://lorempixel.com/400/200/food/3/'); $manager->persist($media2); $media3 = new Media(); $media3->setAlt('Meat'); $media3->setPath('http://lorempixel.com/400/200/food/4/'); $manager->persist($media3); $media4 = new Media(); $media4->setAlt('Other'); $media4->setPath('http://lorempixel.com/400/200/food/1/'); $manager->persist($media4); $media5 = new Media(); $media5->setAlt('Kobe-Beef'); $media5->setPath('http://lorempixel.com/400/200/food/2/'); $manager->persist($media5); $media6 = new Media(); $media6->setAlt('Tomato'); $media6->setPath('http://lorempixel.com/400/200/food/7/'); $manager->persist($media6); $media7 = new Media(); $media7->setAlt('Carrot'); $media7->setPath('http://lorempixel.com/400/200/food/8/'); $manager->persist($media7); $media8 = new Media(); $media8->setAlt('Salad'); $media8->setPath('http://lorempixel.com/400/200/food/9/'); $manager->persist($media8); $manager->flush(); $this->addReference('media-vegetable', $media1); $this->addReference('media-fruit', $media2); $this->addReference('media-meat', $media3); $this->addReference('media-other', $media4); $this->addReference('media-kobe_beef', $media5); $this->addReference('media-tomato', $media6); $this->addReference('media-carrot', $media7); $this->addReference('media-salad', $media8); }
public function load(ObjectManager $manager) { $media1 = new Media(); $media1->setPath('http://cp.lakanal.free.fr/exercices/jeux/memory/legumes/legumes.png'); $media1->setAlt('Légumes'); $manager->persist($media1); $media2 = new Media(); $media2->setPath('http://img0.mxstatic.com/wallpapers/238cdfc903a19ad39ea901619dd55d47_large.jpeg'); $media2->setAlt('Fruits'); $manager->persist($media2); $media3 = new Media(); $media3->setPath('http://cuisine.larousse.fr/lcfilestorage/8A/DA/POIVRON_D_636x380.jpg'); $media3->setAlt('Poivron rouge'); $manager->persist($media3); $media4 = new Media(); $media4->setPath('http://www.princedebretagne-pro.com/medias/5114fcd91ae7e.JPG'); $media4->setAlt('Piment'); $manager->persist($media4); $media5 = new Media(); $media5->setPath('http://www.niffylux.com/image-gratuite/Tomate__7_4b71e7e13f85b.jpg'); $media5->setAlt('Tomate'); $manager->persist($media5); $media6 = new Media(); $media6->setPath('http://le-mag-de-lea.com/wp-content/uploads/Poivron-vert-11.jpg'); $media6->setAlt('Poivron vert'); $manager->persist($media6); $media7 = new Media(); $media7->setPath('http://www.boitearecettes.com/fruits_legumes/raisins-6.gif'); $media7->setAlt('Raisin'); $manager->persist($media7); $media8 = new Media(); $media8->setPath('http://www.orangeclaire.com/images/oce_orange_01.jpg'); $media8->setAlt('Orange'); $manager->persist($media8); $manager->flush(); $this->addReference('media1', $media1); $this->addReference('media2', $media2); $this->addReference('media3', $media3); $this->addReference('media4', $media4); $this->addReference('media5', $media5); $this->addReference('media6', $media6); $this->addReference('media7', $media7); $this->addReference('media8', $media8); }
public function setPath($path) { $this->__load(); return parent::setPath($path); }
/** * {@inheritDoc} */ public function setPath($path) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setPath', array($path)); return parent::setPath($path); }