コード例 #1
0
 /**
  * Get product storage (ORM/MongoDBODM)
  *
  * @return string
  */
 protected function getProductStorage()
 {
     $om = $this->productManager->getObjectManager();
     if ($om instanceof \Doctrine\ORM\EntityManagerInterface) {
         return AkeneoStorageUtilsExtension::DOCTRINE_ORM;
     }
     return AkeneoStorageUtilsExtension::DOCTRINE_MONGODB_ODM;
 }
コード例 #2
0
 /**
  * Get product storage (ORM/MongoDBODM)
  *
  * @return string
  */
 protected function getProductStorage()
 {
     $om = $this->productManager->getObjectManager();
     if ($om instanceof \Doctrine\ORM\EntityManagerInterface) {
         return \Pim\Bundle\CatalogBundle\DependencyInjection\PimCatalogExtension::DOCTRINE_ORM;
     } else {
         return \Pim\Bundle\CatalogBundle\DependencyInjection\PimCatalogExtension::DOCTRINE_MONGODB_ODM;
     }
 }
コード例 #3
0
 /**
  * @param ProductValueInterface $productValue
  * @param ProductValueInterface $value
  */
 protected function setProductOption(ProductValueInterface $productValue, ProductValueInterface $value)
 {
     foreach ($productValue->getOptions() as $option) {
         if (!$value->getOptions()->contains($option)) {
             $productValue->removeOption($option);
         }
     }
     // TODO: Clean this code removing flush for ORM
     if (!class_exists(PimCatalogBundle::DOCTRINE_MONGODB)) {
         $this->productManager->getObjectManager()->flush();
     }
     foreach ($value->getOptions() as $option) {
         $productValue->addOption($option);
     }
 }