예제 #1
0
 public function initializeOrUpdate()
 {
     $localCopyForCsvFile = $this->sourceFile->createTemporaryLocalCopy();
     $csvReader = Reader::createFromPath($localCopyForCsvFile);
     $csvReader->setDelimiter(';');
     $csv = $csvReader->fetchAssoc();
     $output = array();
     foreach ($csv as $row) {
         $output[] = json_encode($row);
     }
     Files::createDirectoryRecursively(dirname($this->getSourceFileName()));
     file_put_contents($this->getSourceFileName(), implode("\n", $output));
     parent::initializeOrUpdate();
 }
 /**
  * @param ReceiverSource $receiverSource
  * @return void
  */
 public function refreshAction(ReceiverSource $receiverSource)
 {
     $receiverSource->initializeOrUpdate();
     $this->receiverSourceRepository->update($receiverSource);
     $this->persistenceManager->whitelistObject($receiverSource);
     $this->redirect('index');
 }
예제 #3
0
 public function getFullLabel()
 {
     return $this->receiverSource->getName() . ' - ' . $this->name;
 }