public function preFlush(PreFlushEventArgs $args)
    {
        $objectManager = $args->getEntityManager();
        $unitOfWork = $objectManager->getUnitOfWork();

        $entityMap = $unitOfWork->getIdentityMap();
        foreach ($entityMap as $objectClass => $objects) {
            if (in_array(UploadObjectInterface::class, class_implements($objectClass))) {
                foreach ($objects as $object) {
                    $this->prepareUploadFileReferences($object);
                }
            }
        }
    }
public function preFlush(PreFlushEventArgs $args)
    {
        $objectManager = $args->getEntityManager();
        $unitOfWork = $objectManager->getUnitOfWork();

        $entityMap = $unitOfWork->getIdentityMap();
        foreach ($entityMap as $objectClass => $objects) {
            if (in_array(UploadObjectInterface::class, class_implements($objectClass))) {
                foreach ($objects as $object) {
                    $this->prepareUploadFileReferences($object);
                }
            }
        }
    }
public function preFlush ( PreFlushEventArgs $ args ) { $ objectManager = $ args -> getEntityManager ( ) ; $ unitOfWork = $ objectManager -> getUnitOfWork ( ) ; $ entityMap = $ unitOfWork -> getIdentityMap ( ) ; foreach ( $ entityMap as $ objectClass => $ objects ) { if ( in_array ( UploadObjectInterface :: class , class_implements ( $ objectClass ) ) ) { foreach ( $ objects as $ object ) { $ this -> prepareUploadFileReferences ( $ object ) ; } } } }
Prepares upload file references for all objects implementing the UploadObjectInterface.

@param PreFlushEventArgs $args
Prepares upload file references for all objects implementing the UploadObjectInterface .