Inheritance: extends PartKeepr\CoreBundle\Entity\BaseEntity
コード例 #1
0
 public function load(ObjectManager $manager)
 {
     $manufacturer = new Manufacturer();
     $manufacturer->setName('TEST');
     $manager->persist($manufacturer);
     $manager->flush();
     $this->addReference('manufacturer.first', $manufacturer);
 }
コード例 #2
0
 protected function createManufacturer($manufacturerName, $manufacturerData)
 {
     $manufacturer = new Manufacturer();
     $manufacturer->setName($manufacturerName);
     if (array_key_exists('iclogos', $manufacturerData)) {
         foreach ($manufacturerData['iclogos'] as $icLogo) {
             $manufacturerIcLogo = new ManufacturerICLogo();
             $file = $this->kernel->locateResource(self::MANUFACTURER_PATH . $icLogo);
             $this->uploadedFileService->replaceFromFilesystem($manufacturerIcLogo, new File($file));
             $manufacturer->addIcLogo($manufacturerIcLogo);
         }
     }
     $this->entityManager->persist($manufacturer);
 }
コード例 #3
0
 protected function createManufacturer($manufacturerName, $manufacturerData)
 {
     $fileService = $this->get("partkeepr_uploadedfile_service");
     $manufacturer = new Manufacturer();
     $manufacturer->setName($manufacturerName);
     if (array_key_exists("iclogos", $manufacturerData)) {
         foreach ($manufacturerData["iclogos"] as $icLogo) {
             $manufacturerIcLogo = new ManufacturerICLogo();
             $file = $this->get("kernel")->locateResource(self::MANUFACTURER_PATH . $icLogo);
             $fileService->replaceFromFilesystem($manufacturerIcLogo, new File($file));
             $manufacturer->addIcLogo($manufacturerIcLogo);
         }
     }
     $this->get("doctrine.orm.default_entity_manager")->persist($manufacturer);
 }