Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

36 lines
1.1KB

  1. <?php
  2. namespace Lc\CaracoleBundle\EventSubscriber\Product;
  3. use Doctrine\ORM\EntityManagerInterface;
  4. use Lc\CaracoleBundle\Model\Product\ProductFamilySectionPropertyInterface;
  5. use Lc\SovBundle\Event\EntityManager\EntityManagerEvent;
  6. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  7. class UpdateProductFamilySectionPropertyEventSubscriber implements EventSubscriberInterface
  8. {
  9. protected EntityManagerInterface $entityManager;
  10. public function __construct(EntityManagerInterface $entityManager)
  11. {
  12. $this->entityManager = $entityManager;
  13. }
  14. public static function getSubscribedEvents()
  15. {
  16. return [
  17. EntityManagerEvent::PRE_CREATE_EVENT => ['processBeforePersistProductFamilySectionInterface'],
  18. EntityManagerEvent::PRE_UPDATE_EVENT => ['processBeforePersistProductFamilySectionInterface'],
  19. ];
  20. }
  21. public function processBeforePersistProductFamilySectionInterface(EntityManagerEvent $event)
  22. {
  23. //TODO à supprimer déplacer dans le script d'import, à remplacer par une alerte à l'édition d'un produit
  24. }
  25. }