Heratio Framework API Reference

MetadataTemplateRegistry
in package

Registry for metadata template providers.

Plugins register their metadata template support here instead of being hardcoded in QubitMetadataRoute::$METADATA_PLUGINS.

Usage: // In plugin configuration initialize(): MetadataTemplateRegistry::register($this);

// To get plugin for a template: $plugin = MetadataTemplateRegistry::getPluginForTemplate('museum');

Table of Contents

Methods

clear()  : void
Clear all registered providers (useful for testing).
getModuleForTemplate()  : string|null
Get module name for a template.
getPluginForTemplate()  : string|null
Get plugin name for a template.
getTemplateCodes()  : array<string|int, string>
Get all available template codes.
getTemplatePluginMap()  : array<string, string>
Get all templates mapped to their plugins.
hasTemplate()  : bool
Check if a template is available.
register()  : void
Register a metadata template provider.

Methods

getModuleForTemplate()

Get module name for a template.

public static getModuleForTemplate(string $code) : string|null
Parameters
$code : string
Return values
string|null

getPluginForTemplate()

Get plugin name for a template.

public static getPluginForTemplate(string $code) : string|null
Parameters
$code : string
Return values
string|null

getTemplateCodes()

Get all available template codes.

public static getTemplateCodes() : array<string|int, string>
Return values
array<string|int, string>

getTemplatePluginMap()

Get all templates mapped to their plugins.

public static getTemplatePluginMap() : array<string, string>

This provides the same format as the old QubitMetadataRoute::$METADATA_PLUGINS.

Return values
array<string, string>

hasTemplate()

Check if a template is available.

public static hasTemplate(string $code) : bool
Parameters
$code : string
Return values
bool

        
On this page

Search results