/** * @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]); } }
/** * @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.'); }
/** * Closes the files * * @param AbstractFile $file * @param AbstractFile|null $clearFile */ protected function close(AbstractFile $file, AbstractFile $clearFile = null) { $file->close(); if ($clearFile) { $clearFile->close(); } }