src/Bridge/Doctrine/EventListener/PublishMercureUpdatesListener.php
public function onFlush(OnFlushEventArgs $eventArgs): void
    {
        $uow = $eventArgs->getEntityManager()->getUnitOfWork();

        foreach ($uow->getScheduledEntityInsertions() as $entity) {
            $this->storeEntityToPublish($entity, 'createdEntities');
        }

        foreach ($uow->getScheduledEntityUpdates() as $entity) {
            $this->storeEntityToPublish($entity, 'updatedEntities');
        }

        foreach ($uow->getScheduledEntityDeletions() as $entity) {
            $this->storeEntityToPublish($entity, 'deletedEntities');
        }
    }
public function onFlush(OnFlushEventArgs $eventArgs): void
    {
        $uow = $eventArgs->getEntityManager()->getUnitOfWork();

        foreach ($uow->getScheduledEntityInsertions() as $entity) {
            $this->storeEntityToPublish($entity, 'createdEntities');
        }

        foreach ($uow->getScheduledEntityUpdates() as $entity) {
            $this->storeEntityToPublish($entity, 'updatedEntities');
        }

        foreach ($uow->getScheduledEntityDeletions() as $entity) {
            $this->storeEntityToPublish($entity, 'deletedEntities');
        }
    }
public function onFlush ( OnFlushEventArgs $ eventArgs ) : void { $ uow = $ eventArgs -> getEntityManager ( ) -> getUnitOfWork ( ) ; foreach ( $ uow -> getScheduledEntityInsertions ( ) as $ entity ) { $ this -> storeEntityToPublish ( $ entity , 'createdEntities' ) ; } foreach ( $ uow -> getScheduledEntityUpdates ( ) as $ entity ) { $ this -> storeEntityToPublish ( $ entity , 'updatedEntities' ) ; } foreach ( $ uow -> getScheduledEntityDeletions ( ) as $ entity ) { $ this -> storeEntityToPublish ( $ entity , 'deletedEntities' ) ; } }
Collects created, updated and deleted entities.
Collects created updated and deleted entities .