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

void
addMapper(string $id, Mapper $mapper)

Registers a new asset mapper under a specific identifier.

getMapper(string $id = self::DefaultScope)

Retrieves a registered asset mapper by its identifier.

Asset|null
getAsset(string|array $qualifiedRef, array $options = [])

Retrieves an Asset instance using a qualified reference. Accepts either 'mapper:reference' or ['mapper', 'reference'].

Details

at line 29
void addMapper(string $id, Mapper $mapper)

Registers a new asset mapper under a specific identifier.

Parameters

string $id
Mapper $mapper

Return Value

void

Exceptions

InvalidArgumentException

at line 42
Mapper getMapper(string $id = self::DefaultScope)

Retrieves a registered asset mapper by its identifier.

Parameters

string $id

Return Value

Mapper

Exceptions

InvalidArgumentException

at line 52
Asset|null 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.

Parameters

string|array $qualifiedRef
array $options

Return Value

Asset|null