YieldRows.php in Migrate Source CSV 8.2
File
tests/modules/source_plugin_yield_test/src/Plugin/migrate/source/YieldRows.php
View source
<?php
namespace Drupal\source_plugin_yield_test\Plugin\migrate\source;
use Drupal\migrate_source_csv\Plugin\migrate\source\CSV;
class YieldRows extends CSV {
public function initializeIterator() {
$file = parent::initializeIterator();
return $this
->getYield($file);
}
public function getYield(\SplFileObject $file) {
foreach ($file as $row_num => $row) {
$new_row = [];
$new_row['id'] = $row['id'];
(yield $new_row);
}
}
}