Registry
class Registry
Manages a collection of named asset Mappers and provides a central point for retrieving Assets using qualified references (mapper:reference).
Includes a simple cache for resolved assets.
Constants
| DefaultScope |
|
| private MaxCacheSize |
|
Methods
getMapper(string $id = self::DefaultScope)
Returns the mapper registered under the given identifier.
getAsset(string|array $qualifiedRef, array $options = [])
Returns an Asset for the given qualified reference ('mapper:reference' or ['mapper', 'reference']).
Asset|null
tryGetAsset(string|array $qualifiedRef, array $options = [])
Returns an Asset for the given qualified reference, or null if not found.
Details
at line 29
void
addMapper(string $id, Mapper $mapper)
Registers an asset mapper under the given identifier.
at line 42
Mapper
getMapper(string $id = self::DefaultScope)
Returns the mapper registered under the given identifier.
at line 54
Asset
getAsset(string|array $qualifiedRef, array $options = [])
Returns an Asset for the given qualified reference ('mapper:reference' or ['mapper', 'reference']).
at line 93
Asset|null
tryGetAsset(string|array $qualifiedRef, array $options = [])
Returns an Asset for the given qualified reference, or null if not found.