Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function processRow(RowInterface $row)
 {
     $output = [];
     foreach ($row->getData() as $key => $value) {
         $output[] = "{$key}: {$value}";
     }
     $output = implode(', ', $output);
     print "{$output}\n";
 }
Example #2
0
 /**
  * @param resource $handle
  *   The file handle to write to.
  * @param \Devour\Row\RowInterface $row
  *   The row to write to the file.
  */
 protected function processRow($handle, RowInterface $row)
 {
     fputcsv($handle, $row->getData(), $this->delimeter, $this->enclosure);
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 protected function processRow(RowInterface $row)
 {
     $item = [];
     foreach ($this->map as $source_field => $target_field) {
         $item[$target_field] = $row->get($source_field);
     }
     if ($this->uniqueColumns && $this->itemIsUnique($item)) {
         if ($this->updateExisting) {
             $this->update($item);
         }
         return;
     }
     $this->prepare($item);
     $this->save($item);
 }