Esempio n. 1
0
 /**
  * @param AbstractFile     $file
  * @param ClassMetadata $metadata
  * @param object        $entity
  * @param array         $properties
  */
 protected function writeClearedProperties(AbstractFile $file, ClassMetadata $metadata, $entity, array $properties)
 {
     $cleared = $this->entityToArray($entity, $properties);
     if ($cleared) {
         $file->writeObject(['identifiers' => $this->entityToArray($entity, $metadata->getIdentifierFieldNames()), 'cleared' => $cleared]);
     }
 }
Esempio n. 2
0
 /**
  * @param AbstractFile $file
  * @param integer $count The number of queued operations on the unit of work
  * @throws \Doxport\Exception\IOException
  * @return void
  */
 protected function flush(AbstractFile $file, $count = null)
 {
     $this->logger->notice('  Flushing and syncing...');
     $file->flush();
     $file->sync();
     $this->logger->notice('  done. Committing deletes...');
     $this->chunk->begin();
     $this->em->flush();
     $this->em->clear();
     $this->chunk->end($count);
     $this->logger->notice('  done.');
 }
Esempio n. 3
0
 /**
  * Closes the files
  *
  * @param AbstractFile $file
  * @param AbstractFile|null $clearFile
  */
 protected function close(AbstractFile $file, AbstractFile $clearFile = null)
 {
     $file->close();
     if ($clearFile) {
         $clearFile->close();
     }
 }