public function ProductVideo::getYield in Commerce Migrate 8.2
Same name and namespace in other branches
- 3.1.x modules/csv_example/src/Plugin/migrate/source/ProductVideo.php \Drupal\commerce_migrate_csv_example\Plugin\migrate\source\ProductVideo::getYield()
- 3.0.x modules/csv_example/src/Plugin/migrate/source/ProductVideo.php \Drupal\commerce_migrate_csv_example\Plugin\migrate\source\ProductVideo::getYield()
Prepare one row per product video paragraph entity in the source row.
@codingStandardsIgnoreStart
@codingStandardsIgnoreEnd
Parameters
\Generator $file: The source CSV file object.
Return value
\Generator A new row, one for each filename in the source image column.
1 call to ProductVideo::getYield()
- ProductVideo::initializeIterator in modules/
csv_example/ src/ Plugin/ migrate/ source/ ProductVideo.php
File
- modules/
csv_example/ src/ Plugin/ migrate/ source/ ProductVideo.php, line 40
Class
- ProductVideo
- Yields values for product video paragraph.
Namespace
Drupal\commerce_migrate_csv_example\Plugin\migrate\sourceCode
public function getYield(\Generator $file) {
foreach ($file as $row) {
if (!empty($row['video1']) && !empty($row['thumbnail1'])) {
(yield $row);
}
}
}