You are here

public function YieldRows::getYield in Migrate Source CSV 8.3

Prepare a test row using yield.

@codingStandardsIgnoreStart

@codingStandardsIgnoreEnd

Parameters

\League\Csv\Reader $reader: The CSV reader.

Return value

\Generator A generator with only the id value.

1 call to YieldRows::getYield()
YieldRows::initializeIterator in tests/modules/csv_source_yield_test/src/Plugin/migrate/source/YieldRows.php
Initializes the iterator with the source data.

File

tests/modules/csv_source_yield_test/src/Plugin/migrate/source/YieldRows.php, line 37

Class

YieldRows
Yields each image and sku.

Namespace

Drupal\csv_source_yield_test\Plugin\migrate\source

Code

public function getYield(Reader $reader) {
  foreach ($reader as $row) {
    $new_row = [];
    $new_row['id'] = $row['id'];
    (yield $new_row);
  }
}