LevelOfDescriptionService
in package
Level of Description Service.
Manages archival levels with GLAM sector filtering.
Table of Contents
Constants
- ALL_SECTORS = [self::SECTOR_ARCHIVE, self::SECTOR_MUSEUM, self::SECTOR_LIBRARY, self::SECTOR_GALLERY, self::SECTOR_DAM]
- SECTOR_ARCHIVE = 'archive'
- SECTOR_DAM = 'dam'
- SECTOR_DEFAULT_LEVELS = [self::SECTOR_ARCHIVE => ['Record group', 'Fonds', 'Subfonds', 'Collection', 'Series', 'Subseries', 'File', 'Item', 'Part'], self::SECTOR_MUSEUM => ['3D Model', 'Artifact', 'Artwork', 'Installation', 'Object', 'Specimen'], self::SECTOR_LIBRARY => ['Book', 'Monograph', 'Periodical', 'Journal', 'Article', 'Manuscript', 'Document'], self::SECTOR_GALLERY => ['Artwork', 'Photograph', 'Installation'], self::SECTOR_DAM => ['Photograph', 'Audio', 'Video', 'Image', 'Document', '3D Model', 'Dataset']]
- SECTOR_GALLERY = 'gallery'
- SECTOR_LIBRARY = 'library'
- SECTOR_MUSEUM = 'museum'
- SECTOR_PLUGINS = [ self::SECTOR_ARCHIVE => null, // Always available self::SECTOR_MUSEUM => ['sfMuseumPlugin', 'ahgMuseumPlugin'], self::SECTOR_LIBRARY => ['ahgLibraryPlugin', 'arLibraryPlugin'], self::SECTOR_GALLERY => ['arGalleryPlugin', 'ahgGalleryPlugin'], self::SECTOR_DAM => ['ahgDAMPlugin', 'arDAMPlugin'], ]
- TAXONOMY_ID = 34
Methods
- countBySector() : array<string|int, mixed>
- Count levels per sector.
- detectCurrentSector() : string|null
- Detect current sector from template setting or context.
- getAll() : Collection
- Get all levels of description.
- getAvailableSectors() : array<string|int, mixed>
- Get available sectors based on enabled plugins.
- getById() : object|null
- Get level by ID.
- getBySector() : Collection
- Get levels by sector (from level_of_description_sector table).
- getBySectors() : Collection
- Get levels for multiple sectors.
- getChoices() : array<string|int, mixed>
- Get levels as form choices.
- getChoicesForContext() : array<string|int, mixed>
- Get choices for current context.
- getForCurrentContext() : Collection
- Get levels for current context (auto-detect sector from template setting).
- getGroupedBySector() : array<string|int, mixed>
- Get levels grouped by sector.
- getLevelsForSector() : Collection
- Get levels appropriate for a sector (based on SECTOR_DEFAULT_LEVELS).
- getSectorFromTemplate() : string
- Get sector from template name.
- isPluginEnabled() : bool
- Check if a plugin is enabled.
Constants
ALL_SECTORS
public
mixed
ALL_SECTORS
= [self::SECTOR_ARCHIVE, self::SECTOR_MUSEUM, self::SECTOR_LIBRARY, self::SECTOR_GALLERY, self::SECTOR_DAM]
SECTOR_ARCHIVE
public
mixed
SECTOR_ARCHIVE
= 'archive'
SECTOR_DAM
public
mixed
SECTOR_DAM
= 'dam'
SECTOR_DEFAULT_LEVELS
public
mixed
SECTOR_DEFAULT_LEVELS
= [self::SECTOR_ARCHIVE => ['Record group', 'Fonds', 'Subfonds', 'Collection', 'Series', 'Subseries', 'File', 'Item', 'Part'], self::SECTOR_MUSEUM => ['3D Model', 'Artifact', 'Artwork', 'Installation', 'Object', 'Specimen'], self::SECTOR_LIBRARY => ['Book', 'Monograph', 'Periodical', 'Journal', 'Article', 'Manuscript', 'Document'], self::SECTOR_GALLERY => ['Artwork', 'Photograph', 'Installation'], self::SECTOR_DAM => ['Photograph', 'Audio', 'Video', 'Image', 'Document', '3D Model', 'Dataset']]
SECTOR_GALLERY
public
mixed
SECTOR_GALLERY
= 'gallery'
SECTOR_LIBRARY
public
mixed
SECTOR_LIBRARY
= 'library'
SECTOR_MUSEUM
public
mixed
SECTOR_MUSEUM
= 'museum'
SECTOR_PLUGINS
public
mixed
SECTOR_PLUGINS
= [
self::SECTOR_ARCHIVE => null,
// Always available
self::SECTOR_MUSEUM => ['sfMuseumPlugin', 'ahgMuseumPlugin'],
self::SECTOR_LIBRARY => ['ahgLibraryPlugin', 'arLibraryPlugin'],
self::SECTOR_GALLERY => ['arGalleryPlugin', 'ahgGalleryPlugin'],
self::SECTOR_DAM => ['ahgDAMPlugin', 'arDAMPlugin'],
]
TAXONOMY_ID
public
mixed
TAXONOMY_ID
= 34
Methods
countBySector()
Count levels per sector.
public
static countBySector() : array<string|int, mixed>
Return values
array<string|int, mixed>detectCurrentSector()
Detect current sector from template setting or context.
public
static detectCurrentSector() : string|null
Return values
string|nullgetAll()
Get all levels of description.
public
static getAll([string|null $culture = null ]) : Collection
Parameters
- $culture : string|null = null
Return values
CollectiongetAvailableSectors()
Get available sectors based on enabled plugins.
public
static getAvailableSectors() : array<string|int, mixed>
Return values
array<string|int, mixed>getById()
Get level by ID.
public
static getById(int $id[, string|null $culture = null ]) : object|null
Parameters
- $id : int
- $culture : string|null = null
Return values
object|nullgetBySector()
Get levels by sector (from level_of_description_sector table).
public
static getBySector(string $sector[, string|null $culture = null ]) : Collection
Parameters
- $sector : string
- $culture : string|null = null
Return values
CollectiongetBySectors()
Get levels for multiple sectors.
public
static getBySectors(array<string|int, mixed> $sectors[, string|null $culture = null ]) : Collection
Parameters
- $sectors : array<string|int, mixed>
- $culture : string|null = null
Return values
CollectiongetChoices()
Get levels as form choices.
public
static getChoices([string|null $sector = null ][, string|null $culture = null ]) : array<string|int, mixed>
Parameters
- $sector : string|null = null
- $culture : string|null = null
Return values
array<string|int, mixed>getChoicesForContext()
Get choices for current context.
public
static getChoicesForContext([string|null $culture = null ]) : array<string|int, mixed>
Parameters
- $culture : string|null = null
Return values
array<string|int, mixed>getForCurrentContext()
Get levels for current context (auto-detect sector from template setting).
public
static getForCurrentContext([string|null $culture = null ]) : Collection
Parameters
- $culture : string|null = null
Return values
CollectiongetGroupedBySector()
Get levels grouped by sector.
public
static getGroupedBySector([string|null $culture = null ]) : array<string|int, mixed>
Parameters
- $culture : string|null = null
Return values
array<string|int, mixed>getLevelsForSector()
Get levels appropriate for a sector (based on SECTOR_DEFAULT_LEVELS).
public
static getLevelsForSector(string $sector[, string|null $culture = null ]) : Collection
Parameters
- $sector : string
- $culture : string|null = null
Return values
CollectiongetSectorFromTemplate()
Get sector from template name.
public
static getSectorFromTemplate(string $template) : string
Parameters
- $template : string
Return values
stringisPluginEnabled()
Check if a plugin is enabled.
public
static isPluginEnabled(string $pluginName) : bool
Parameters
- $pluginName : string