original_string: public function onFlush(OnFlushEventArgs $eventArgs)
      {
          $em = $eventArgs->getEntityManager();
          $uow = $em->getUnitOfWork();
  
          foreach ($uow->getScheduledEntityInsertions() as $entity) {
              $this->debug('Inserting entity '.get_class($entity).'. Fields: '.
                               json_encode($uow->getEntityChangeSet($entity)));
          }
  
          foreach ($uow->getScheduledEntityUpdates() as $entity) {
              $add = '';
              if (method_exists($entity, '__toString')) {
                  $add = ' '.$entity->__toString();
              } elseif (method_exists($entity, 'getId')) {
                  $add = ' with id '.$entity->getId();
              }
  
              $this->debug('Updating entity '.get_class($entity).$add.'. Data: '.
                               json_encode($uow->getEntityChangeSet($entity)));
          }
  
          foreach ($uow->getScheduledEntityDeletions() as $entity) {
              $add = '';
              if (method_exists($entity, '__toString')) {
                  $add = ' '.$entity->__toString();
              } elseif (method_exists($entity, 'getId')) {
                  $add = ' with id '.$entity->getId();
              }
  
              $this->debug('Deleting entity '.get_class($entity).$add.'.');
          }
      }
code: public function onFlush(OnFlushEventArgs $eventArgs)
      {
          $em = $eventArgs->getEntityManager();
          $uow = $em->getUnitOfWork();
  
          foreach ($uow->getScheduledEntityInsertions() as $entity) {
              $this->debug('Inserting entity '.get_class($entity).'. Fields: '.
                               json_encode($uow->getEntityChangeSet($entity)));
          }
  
          foreach ($uow->getScheduledEntityUpdates() as $entity) {
              $add = '';
              if (method_exists($entity, '__toString')) {
                  $add = ' '.$entity->__toString();
              } elseif (method_exists($entity, 'getId')) {
                  $add = ' with id '.$entity->getId();
              }
  
              $this->debug('Updating entity '.get_class($entity).$add.'. Data: '.
                               json_encode($uow->getEntityChangeSet($entity)));
          }
  
          foreach ($uow->getScheduledEntityDeletions() as $entity) {
              $add = '';
              if (method_exists($entity, '__toString')) {
                  $add = ' '.$entity->__toString();
              } elseif (method_exists($entity, 'getId')) {
                  $add = ' with id '.$entity->getId();
              }
  
              $this->debug('Deleting entity '.get_class($entity).$add.'.');
          }
      }
code_tokens: public function onFlush ( OnFlushEventArgs $ eventArgs ) { $ em = $ eventArgs -> getEntityManager ( ) ; $ uow = $ em -> getUnitOfWork ( ) ; foreach ( $ uow -> getScheduledEntityInsertions ( ) as $ entity ) { $ this -> debug ( 'Inserting entity ' . get_class ( $ entity ) . '. Fields: ' . json_encode ( $ uow -> getEntityChangeSet ( $ entity ) ) ) ; } foreach ( $ uow -> getScheduledEntityUpdates ( ) as $ entity ) { $ add = '' ; if ( method_exists ( $ entity , '__toString' ) ) { $ add = ' ' . $ entity -> __toString ( ) ; } elseif ( method_exists ( $ entity , 'getId' ) ) { $ add = ' with id ' . $ entity -> getId ( ) ; } $ this -> debug ( 'Updating entity ' . get_class ( $ entity ) . $ add . '. Data: ' . json_encode ( $ uow -> getEntityChangeSet ( $ entity ) ) ) ; } foreach ( $ uow -> getScheduledEntityDeletions ( ) as $ entity ) { $ add = '' ; if ( method_exists ( $ entity , '__toString' ) ) { $ add = ' ' . $ entity -> __toString ( ) ; } elseif ( method_exists ( $ entity , 'getId' ) ) { $ add = ' with id ' . $ entity -> getId ( ) ; } $ this -> debug ( 'Deleting entity ' . get_class ( $ entity ) . $ add . '.' ) ; } }
docstring: Logs the entity changes
  
  @param \Doctrine\ORM\Event\OnFlushEventArgs $eventArgs
docstring_tokens: Logs the entity changes