/**
  * @param Import $import
  *
  * @return string
  */
 protected function getLogIdent(Import $import)
 {
     return sprintf('import-%d', $import->getId());
 }
Пример #2
0
 /**
  * @param Import $import
  *
  * @return string
  */
 public function getImportDir(Import $import)
 {
     return sprintf('%s/%s', $this->feedDir, $import->getId());
 }
Пример #3
0
 /**
  * Returns default options to pass to the reader builder.
  *
  * @param Import $import
  *
  * @return array
  */
 protected function getDefaultReaderOptions(Import $import)
 {
     return ['partial' => $import->isPartial(), 'forced' => $import->isForced()];
 }
Пример #4
0
 /**
  * @param Import       $import
  * @param ImportResult $result
  */
 public function addResult(Import $import, ImportResult $result)
 {
     $query = $this->createQueryBuilder('i')->update()->set('i.success', 'i.success + :success')->set('i.failed', 'i.failed + :failed')->set('i.skipped', 'i.skipped + :skipped')->where('i.id = :id')->getQuery();
     $query->execute(['id' => $import->getId(), 'success' => $result->getSuccess(), 'failed' => $result->getFailed(), 'skipped' => $result->getSkipped()]);
     $this->getEntityManager()->refresh($import);
 }