protected function Json::fetchNextRow in Migrate Plus 8.5
Same name and namespace in other branches
- 8 src/Plugin/migrate_plus/data_parser/Json.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\Json::fetchNextRow()
- 8.2 src/Plugin/migrate_plus/data_parser/Json.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\Json::fetchNextRow()
- 8.3 src/Plugin/migrate_plus/data_parser/Json.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\Json::fetchNextRow()
- 8.4 src/Plugin/migrate_plus/data_parser/Json.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\Json::fetchNextRow()
Retrieves the next row of data. populating currentItem.
Retrieves from the open source URL.
Overrides DataParserPluginBase::fetchNextRow
File
- src/
Plugin/ migrate_plus/ data_parser/ Json.php, line 108
Class
- Json
- Obtain JSON data for migration.
Namespace
Drupal\migrate_plus\Plugin\migrate_plus\data_parserCode
protected function fetchNextRow() {
$current = $this->iterator
->current();
if ($current) {
foreach ($this
->fieldSelectors() as $field_name => $selector) {
$field_data = $current;
$field_selectors = explode('/', trim($selector, '/'));
foreach ($field_selectors as $field_selector) {
if (is_array($field_data) && array_key_exists($field_selector, $field_data)) {
$field_data = $field_data[$field_selector];
}
else {
$field_data = '';
}
}
$this->currentItem[$field_name] = $field_data;
}
if (!empty($this->configuration['include_raw_data'])) {
$this->currentItem['raw'] = $current;
}
$this->iterator
->next();
}
}