public function MigrateTemplateStorage::findTemplatesByTag in Migrate Manifest 8.2
Same name and namespace in other branches
- 8 src/MigrateTemplateStorage.php \Drupal\migrate_manifest\MigrateTemplateStorage::findTemplatesByTag()
- 3.x src/MigrateTemplateStorage.php \Drupal\migrate_manifest\MigrateTemplateStorage::findTemplatesByTag()
Find all migration templates with the specified tag.
Parameters
string $tag: The tag to match.
Return value
array Any templates (parsed YAML config) that matched, keyed by the ID.
Overrides MigrateTemplateStorageInterface::findTemplatesByTag
File
- src/
MigrateTemplateStorage.php, line 44
Class
- MigrateTemplateStorage
- Storage to access migration template configuration in enabled extensions.
Namespace
Drupal\migrate_manifestCode
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;
}