public function preFlush(PreFlushEventArgs $args)
    {
        $entityManager = $args->getEntityManager();
        $scheduledInsertions = $entityManager
            ->getUnitOfWork()
            ->getScheduledEntityInsertions();

        $this
            ->categoryIntegrityFixer
            ->fixCategoriesIntegrityByArray($scheduledInsertions);
    }
public function preFlush(PreFlushEventArgs $args)
    {
        $entityManager = $args->getEntityManager();
        $scheduledInsertions = $entityManager
            ->getUnitOfWork()
            ->getScheduledEntityInsertions();

        $this
            ->categoryIntegrityFixer
            ->fixCategoriesIntegrityByArray($scheduledInsertions);
    }
public function preFlush ( PreFlushEventArgs $ args ) { $ entityManager = $ args -> getEntityManager ( ) ; $ scheduledInsertions = $ entityManager -> getUnitOfWork ( ) -> getScheduledEntityInsertions ( ) ; $ this -> categoryIntegrityFixer -> fixCategoriesIntegrityByArray ( $ scheduledInsertions ) ; }
Before the flush we check that the product categories are right.

@param PreFlushEventArgs $args The pre flush event arguments.
Before the flush we check that the product categories are right .