Browse Source

Correctif

feature/symfony6.1
Fabien Normand 3 years ago
parent
commit
e624a53a1b
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      Component/EntityComponent.php

+ 2
- 1
Component/EntityComponent.php View File

@@ -68,8 +68,9 @@ class EntityComponent
$newEntity->setCreatedAt(new \DateTime());
}

$this->entityManager->create($newEntity);
$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->persist($newEntity);

return $newEntity;
}

Loading…
Cancel
Save