public function MigrateTemplateStorage::findTemplatesByTag in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/migrate/src/MigrateTemplateStorage.php \Drupal\migrate\MigrateTemplateStorage::findTemplatesByTag()
Find all migration templates with the specified tag.
Parameters
$tag: The tag to match.
Return value
array Any templates (parsed YAML config) that matched, keyed by the ID.
File
- core/
modules/ migrate/ src/ MigrateTemplateStorage.php, line 52 - Contains \Drupal\migrate\MigrateTemplateStorage.
Class
- MigrateTemplateStorage
- Storage to access migration template configuration in enabled extensions.
Namespace
Drupal\migrateCode
public function findTemplatesByTag($tag) {
$templates = $this
->getAllTemplates();
$matched_templates = [];
foreach ($templates as $template_name => $template) {
if (!empty($template['migration_tags'])) {
if (in_array($tag, $template['migration_tags'])) {
$matched_templates[$template_name] = $template;
}
}
}
return $matched_templates;
}