public function Url::__construct in Migrate Plus 8.3
Same name and namespace in other branches
- 8.5 src/Plugin/migrate/source/Url.php \Drupal\migrate_plus\Plugin\migrate\source\Url::__construct()
- 8 src/Plugin/migrate/source/Url.php \Drupal\migrate_plus\Plugin\migrate\source\Url::__construct()
- 8.2 src/Plugin/migrate/source/Url.php \Drupal\migrate_plus\Plugin\migrate\source\Url::__construct()
- 8.4 src/Plugin/migrate/source/Url.php \Drupal\migrate_plus\Plugin\migrate\source\Url::__construct()
Constructs a \Drupal\Component\Plugin\PluginBase object.
Parameters
array $configuration: A configuration array containing information about the plugin instance.
string $plugin_id: The plugin_id for the plugin instance.
mixed $plugin_definition: The plugin implementation definition.
Overrides SourcePluginExtension::__construct
File
- src/
Plugin/ migrate/ source/ Url.php, line 34
Class
- Url
- Source plugin for retrieving data via URLs.
Namespace
Drupal\migrate_plus\Plugin\migrate\sourceCode
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration) {
if (!is_array($configuration['urls'])) {
$configuration['urls'] = [
$configuration['urls'],
];
}
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration);
$this->sourceUrls = $configuration['urls'];
// Set a default Accept header.
/* $this->headers = array_merge(['Accept' => 'application/json'],
$configuration['headers'] ?: []);*/
// See if this is a paged response with next links. If so, add to the source_urls array.
/* foreach ( (array) $configuration['urls'] as $url) {
$this->sourceUrls += $this->getNextLinks($url);
}*/
}