original_string: public function preFlush(PreFlushEventArgs $event)
      {
          $em = $event->getEntityManager();
          $uow = $em->getUnitOfWork();
  
          /*
           * We need to use the IdentityMap, because the update and persist collection stores entities, that have
           * computed changes, but translation data might have changed without changing it underlying model!
           */
          foreach($uow->getIdentityMap() as $className) {
              foreach($className as $object) {
                  $this->translator->storeTranslationData($object);
              }
          }
      }
code: public function preFlush(PreFlushEventArgs $event)
      {
          $em = $event->getEntityManager();
          $uow = $em->getUnitOfWork();
  
          /*
           * We need to use the IdentityMap, because the update and persist collection stores entities, that have
           * computed changes, but translation data might have changed without changing it underlying model!
           */
          foreach($uow->getIdentityMap() as $className) {
              foreach($className as $object) {
                  $this->translator->storeTranslationData($object);
              }
          }
      }
code_tokens: public function preFlush ( PreFlushEventArgs $ event ) { $ em = $ event -> getEntityManager ( ) ; $ uow = $ em -> getUnitOfWork ( ) ; /*
           * We need to use the IdentityMap, because the update and persist collection stores entities, that have
           * computed changes, but translation data might have changed without changing it underlying model!
           */ foreach ( $ uow -> getIdentityMap ( ) as $ className ) { foreach ( $ className as $ object ) { $ this -> translator -> storeTranslationData ( $ object ) ; } } }
docstring: Before flushing the data, we have to check if some translation data was stored for an object.
  
  @param PreFlushEventArgs $event
docstring_tokens: Before flushing the data we have to check if some translation data was stored for an object .