currentRelease; if ($release === null) { return $article->code; } $release->loadMissing([ 'rootCompositionVersion.composition', 'rootElementVersion.element', ]); return $release->rootCompositionVersion?->composition?->designation ?? $release->rootElementVersion?->element?->working_title ?? $release->classification_note ?? $article->code; } public function kindLabel(LicenseArticle $article): ?string { $release = $article->currentRelease; if ($release === null) { return null; } $release->loadMissing([ 'rootCompositionVersion.composition.editorialContentKind', 'rootElementVersion.element.editorialContentKind', ]); $editorial = $release->rootCompositionVersion?->composition?->editorialContentKind?->label ?? $release->rootElementVersion?->element?->editorialContentKind?->label; if ($editorial !== null) { return $editorial; } $kind = $release->rootCompositionVersion?->composition?->kind; return $kind instanceof CompositionKind ? $kind->label() : null; } }