public function SampleDataLoader::loadPluginByDataType in YAML Content 8.2
1 call to SampleDataLoader::loadPluginByDataType()
- SampleDataLoader::loadSample in modules/
sample_data/ src/ SampleDataLoader.php - Load sample data based on type and additional parameters.
File
- modules/
sample_data/ src/ SampleDataLoader.php, line 111
Class
- SampleDataLoader
- Provides methods for retrieving sample data to be used in demo content.
Namespace
Drupal\sample_dataCode
public function loadPluginByDataType($data_type, array $configuration = []) {
// @todo Handle data types that cannot be found.
$definition = $this
->findPluginByDataType($data_type);
if ($definition) {
return $this
->loadPlugin($definition->id, $configuration);
}
else {
return FALSE;
}
}