Added ability to view part relations on a part info page

This commit is contained in:
Jan Böhmer 2023-11-15 00:44:45 +01:00
parent cc2332a83a
commit 7f612bc371
7 changed files with 143 additions and 0 deletions

View file

@ -136,5 +136,17 @@ class PartAssociation extends AbstractDBElement
return $this;
}
/**
* Returns the translation key for the type of this association.
* If the type is set to OTHER, then the other_type field value is used.
* @return string
*/
public function getTypeTranslationKey(): string
{
if ($this->type === AssociationType::OTHER) {
return $this->other_type ?? 'Unknown';
}
return $this->type->getTranslationKey();
}
}