public function preFlush(PreFlushEventArgs $eventArgs)
    {
        $entityManager = $eventArgs->getEntityManager();
        $unitOfWork = $entityManager->getUnitOfWork();

        foreach ($unitOfWork->getIdentityMap() as $entities) {
            foreach ($entities as $object) {
                $uploadableMeta = $this->getObjectExtendedMetadata($entityManager, $object);
                if (!$uploadableMeta->hasUploadableProperties()) {
                    continue;
                }
                $this->updateFiles($entityManager, $object, $uploadableMeta);
            }
        }
    }
public function preFlush(PreFlushEventArgs $eventArgs)
    {
        $entityManager = $eventArgs->getEntityManager();
        $unitOfWork = $entityManager->getUnitOfWork();

        foreach ($unitOfWork->getIdentityMap() as $entities) {
            foreach ($entities as $object) {
                $uploadableMeta = $this->getObjectExtendedMetadata($entityManager, $object);
                if (!$uploadableMeta->hasUploadableProperties()) {
                    continue;
                }
                $this->updateFiles($entityManager, $object, $uploadableMeta);
            }
        }
    }
public function preFlush ( PreFlushEventArgs $ eventArgs ) { $ entityManager = $ eventArgs -> getEntityManager ( ) ; $ unitOfWork = $ entityManager -> getUnitOfWork ( ) ; foreach ( $ unitOfWork -> getIdentityMap ( ) as $ entities ) { foreach ( $ entities as $ object ) { $ uploadableMeta = $ this -> getObjectExtendedMetadata ( $ entityManager , $ object ) ; if ( ! $ uploadableMeta -> hasUploadableProperties ( ) ) { continue ; } $ this -> updateFiles ( $ entityManager , $ object , $ uploadableMeta ) ; } } }
Check and eventually update files keys.

@param PreFlushEventArgs $eventArgs
Check and eventually update files keys .