mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-27 14:25:02 +02:00
Added ability to view part relations on a part info page
This commit is contained in:
parent
cc2332a83a
commit
7f612bc371
7 changed files with 143 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue