Inheritance: extends PartKeepr\CoreBundle\Entity\BaseEntity
コード例 #1
0
 public function load(ObjectManager $manager)
 {
     $storageLocation = new StorageLocation();
     $storageLocation->setName("test");
     $storageLocation->setCategory($this->getReference("storagelocationcategory.first"));
     $manager->persist($storageLocation);
     $manager->flush();
     $this->addReference("storagelocation.first", $storageLocation);
 }
コード例 #2
0
 public function load(ObjectManager $manager)
 {
     $storageLocation = new StorageLocation();
     $storageLocation->setName('test');
     $storageLocation->setCategory($this->getReference('storagelocationcategory.first'));
     $storageLocation2 = new StorageLocation();
     $storageLocation2->setName('test2');
     $storageLocation2->setCategory($this->getReference('storagelocationcategory.second'));
     $manager->persist($storageLocation);
     $manager->persist($storageLocation2);
     $manager->flush();
     $this->addReference('storagelocation.first', $storageLocation);
     $this->addReference('storagelocation.second', $storageLocation2);
 }