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