private function clearChangeSets()
    {
        $clearChangeSets = function () {
            $this->entityInsertions = $this->entityUpdates
                = $this->entityDeletions
                = $this->extraUpdates
                = $this->entityChangeSets
                = $this->collectionUpdates
                = $this->collectionDeletions
                = $this->visitedCollections
                = $this->scheduledForSynchronization
                = $this->orphanRemovals
                = [];
        };
        $clearChangeSets = $clearChangeSets->bindTo($this->entityManager->getUnitOfWork(), UnitOfWork::class);
        $clearChangeSets();
    }
private function clearChangeSets()
    {
        $clearChangeSets = function () {
            $this->entityInsertions = $this->entityUpdates
                = $this->entityDeletions
                = $this->extraUpdates
                = $this->entityChangeSets
                = $this->collectionUpdates
                = $this->collectionDeletions
                = $this->visitedCollections
                = $this->scheduledForSynchronization
                = $this->orphanRemovals
                = [];
        };
        $clearChangeSets = $clearChangeSets->bindTo($this->entityManager->getUnitOfWork(), UnitOfWork::class);
        $clearChangeSets();
    }
private function clearChangeSets ( ) { $ clearChangeSets = function ( ) { $ this -> entityInsertions = $ this -> entityUpdates = $ this -> entityDeletions = $ this -> extraUpdates = $ this -> entityChangeSets = $ this -> collectionUpdates = $ this -> collectionDeletions = $ this -> visitedCollections = $ this -> scheduledForSynchronization = $ this -> orphanRemovals = [ ] ; } ; $ clearChangeSets = $ clearChangeSets -> bindTo ( $ this -> entityManager -> getUnitOfWork ( ) , UnitOfWork :: class ) ; $ clearChangeSets ( ) ; }
This dirty hack provides an ability to safely commit the unit of work inside postFlush event.
This dirty hack provides an ability to safely commit the unit of work inside postFlush event .