SectorRegistry
in package
Registry for GLAM sector providers.
Plugins register their sector support here instead of being hardcoded in LevelOfDescriptionService::SECTOR_PLUGINS.
Usage: // In plugin configuration initialize(): SectorRegistry::register($this);
// To get all registered sectors: $sectors = SectorRegistry::getSectors();
// To check if a sector is available: if (SectorRegistry::hasSector('museum')) { ... }
Table of Contents
Methods
- clear() : void
- Clear all registered providers (useful for testing).
- getLevels() : array<string|int, string>
- Get default levels for a sector.
- getSector() : array{label: string, levels: string[]}|null
- Get sector information.
- getSectorCodes() : array<string|int, string>
- Get all available sector codes.
- getSectors() : array<string, array{label: string, levels: string[]}>
- Get all sectors with their information.
- hasSector() : bool
- Check if a sector is available (either default or registered).
- register() : void
- Register a sector provider.
Methods
clear()
Clear all registered providers (useful for testing).
public
static clear() : void
getLevels()
Get default levels for a sector.
public
static getLevels(string $code) : array<string|int, string>
Parameters
- $code : string
Return values
array<string|int, string>getSector()
Get sector information.
public
static getSector(string $code) : array{label: string, levels: string[]}|null
Parameters
- $code : string
Return values
array{label: string, levels: string[]}|nullgetSectorCodes()
Get all available sector codes.
public
static getSectorCodes() : array<string|int, string>
Return values
array<string|int, string>getSectors()
Get all sectors with their information.
public
static getSectors() : array<string, array{label: string, levels: string[]}>
Return values
array<string, array{label: string, levels: string[]}>hasSector()
Check if a sector is available (either default or registered).
public
static hasSector(string $code) : bool
Parameters
- $code : string
Return values
boolregister()
Register a sector provider.
public
static register(SectorProviderInterface $provider) : void
Parameters
- $provider : SectorProviderInterface