瀏覽代碼

EntityComponent : adaptation duplicate ProductFamily

develop
Guillaume 11 月之前
父節點
當前提交
cecb72f9bc
共有 1 個檔案被更改,包括 3 行新增1 行删除
  1. +3
    -1
      Component/EntityComponent.php

+ 3
- 1
Component/EntityComponent.php 查看文件

@@ -3,6 +3,7 @@
namespace Lc\SovBundle\Component;

use Doctrine\ORM\EntityManagerInterface;
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\SovBundle\Doctrine\Extension\BlameableInterface;
use Lc\SovBundle\Doctrine\Extension\DevAliasInterface;
use Lc\SovBundle\Doctrine\Extension\SeoInterface;
@@ -31,8 +32,8 @@ class EntityComponent

public function duplicateEntity($entity)
{

$newEntity = clone $entity;

$classMetadata = $this->entityManager->getClassMetadata(get_class($newEntity));

//Dupplication de l'image ou du fichier lier
@@ -69,6 +70,7 @@ class EntityComponent
}

$this->eventDispatcher->dispatch(new EntityComponentEvent($newEntity), EntityComponentEvent::DUPLICATE_EVENT);

//Ne pas utiliser create ici! Sinon pour certaine entité comme ProductFamily on réajoute un orginProduct
$this->entityManager->create($newEntity, false);


Loading…
取消
儲存