protected function Json::getSourceData in Migrate Plus 8
Same name and namespace in other branches
- 8.5 src/Plugin/migrate_plus/data_parser/Json.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\Json::getSourceData()
- 8.2 src/Plugin/migrate_plus/data_parser/Json.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\Json::getSourceData()
- 8.3 src/Plugin/migrate_plus/data_parser/Json.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\Json::getSourceData()
- 8.4 src/Plugin/migrate_plus/data_parser/Json.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\Json::getSourceData()
1 call to Json::getSourceData()
- Json::openSourceUrl in src/
Plugin/ migrate_plus/ data_parser/ Json.php - Opens the specified URL.
File
- src/
Plugin/ migrate_plus/ data_parser/ Json.php, line 109 - Contains Drupal\migrate_plus\Plugin\migrate_plus\data_parser\JSON.
Class
- Json
- Obtain JSON data for migration.
Namespace
Drupal\migrate_plus\Plugin\migrate_plus\data_parserCode
protected function getSourceData($url) {
$iterator = $this
->getSourceIterator($url);
// Recurse through the result array. When there is an array of items at the
// expected depth, pull that array out as a distinct item.
$identifierDepth = $this->itemSelector;
$items = [];
while ($iterator
->valid()) {
$iterator
->next();
$item = $iterator
->current();
if (is_array($item) && $iterator
->getDepth() == $identifierDepth) {
$items[] = $item;
}
}
return $items;
}