src/Entity/Factory/EntityFactory.php
private function stopTransaction(): void
    {
        $validationExceptions = [];
        foreach (self::$created as $entities) {
            foreach ($entities as $entity) {
                $transactionProperty =
                    $entity::getDoctrineStaticMeta()
                           ->getReflectionClass()
                           ->getProperty(AlwaysValidInterface::CREATION_TRANSACTION_RUNNING_PROPERTY);
                $transactionProperty->setAccessible(true);
                $transactionProperty->setValue($entity, false);
                try {
                    $entity->getValidator()->validate();
                } catch (ValidationException $validationException) {
                    $validationExceptions[] = $validationException;
                    continue;
                }
            }
        }
        if ([] !== $validationExceptions) {
            throw new MultipleValidationException($validationExceptions);
        }
        self::$created       = [];
        $this->dtosProcessed = [];
    }
private function stopTransaction(): void
    {
        $validationExceptions = [];
        foreach (self::$created as $entities) {
            foreach ($entities as $entity) {
                $transactionProperty =
                    $entity::getDoctrineStaticMeta()
                           ->getReflectionClass()
                           ->getProperty(AlwaysValidInterface::CREATION_TRANSACTION_RUNNING_PROPERTY);
                $transactionProperty->setAccessible(true);
                $transactionProperty->setValue($entity, false);
                try {
                    $entity->getValidator()->validate();
                } catch (ValidationException $validationException) {
                    $validationExceptions[] = $validationException;
                    continue;
                }
            }
        }
        if ([] !== $validationExceptions) {
            throw new MultipleValidationException($validationExceptions);
        }
        self::$created       = [];
        $this->dtosProcessed = [];
    }
private function stopTransaction ( ) : void { $ validationExceptions = [ ] ; foreach ( self :: $ created as $ entities ) { foreach ( $ entities as $ entity ) { $ transactionProperty = $ entity :: getDoctrineStaticMeta ( ) -> getReflectionClass ( ) -> getProperty ( AlwaysValidInterface :: CREATION_TRANSACTION_RUNNING_PROPERTY ) ; $ transactionProperty -> setAccessible ( true ) ; $ transactionProperty -> setValue ( $ entity , false ) ; try { $ entity -> getValidator ( ) -> validate ( ) ; } catch ( ValidationException $ validationException ) { $ validationExceptions [ ] = $ validationException ; continue ; } } } if ( [ ] !== $ validationExceptions ) { throw new MultipleValidationException ( $ validationExceptions ) ; } self :: $ created = [ ] ; $ this -> dtosProcessed = [ ] ; }
Loop through all created entities and reset the transaction running property to false,
then remove the list of created entities

@throws MultipleValidationException
Loop through all created entities and reset the transaction running property to false then remove the list of created entities