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
Retrieves a registered asset mapper by its identifier.
Retrieves an Asset instance using a qualified reference. Accepts either 'mapper:reference' or ['mapper', 'reference'].
Attempts to retrieve an Asset instance using a qualified reference, but returns null if not found.
Details
at line 29
void
addMapper(string $id, Mapper $mapper)
Registers a new asset mapper under a specific identifier.
at line 42
Mapper
getMapper(string $id = self::DefaultScope)
Retrieves a registered asset mapper by its identifier.
at line 53
Asset
getAsset(string|array $qualifiedRef, array $options = [])
Retrieves an Asset instance using a qualified reference. Accepts either 'mapper:reference' or ['mapper', 'reference'].
Options passed directly to the underlying Mapper::getAsset() method.
at line 85
Asset|null
tryGetAsset(string|array $qualifiedRef, array $options = [])
Attempts to retrieve an Asset instance using a qualified reference, but returns null if not found.
Accepts either 'mapper:reference' or ['mapper', 'reference']. Options passed directly to the underlying Mapper::getAsset() method.