final | |
|---|---|
implements |
VocabularyRegistryInterface |
Runtime registry that resolves alias-qualified OData term names to their fully qualified form.
The registry is initialised once from a VocabularyCatalogInterface and is immutable thereafter. The alias map is built eagerly in the constructor.
The static singleton is lazily initialised from VocabularyCatalog::default() on first call to getInstance(). Annotatable model objects use the singleton to resolve aliases in getAnnotation() without carrying a registry reference in their constructors.
NOTE: This class is not declared readonly because the PHP readonly-class modifier makes ALL typed properties readonly, which includes static properties and prevents the mutable static $instance field required for the lazy-singleton pattern. Instance immutability is preserved by declaring every instance property readonly explicitly.
| Methods | ||
|---|---|---|
public
|
__construct(VocabularyCatalogInterface $catalog)
|
# |
public
static
|
getInstance(): self
|
# |
public
|
resolveAlias(string $alias, string $termName): ?string
|
# |
public
|
fullyQualify(string $term): ?string
|
# |
public
|
getAliasMap(): array<string, string>
|
# |
public
|
hasAlias(string $alias): bool
|
# |