mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-28 20:50:06 +02:00
Added a seperate field for specifying the other relation
This commit is contained in:
parent
5bd2d9b344
commit
c7892cb9e2
3 changed files with 24 additions and 4 deletions
|
@ -47,8 +47,14 @@ class PartAssociation extends AbstractDBElement
|
|||
protected AssociationType $type = AssociationType::OTHER;
|
||||
|
||||
/**
|
||||
* @var string|null A comment describing this association further. Can also be used to specify the OTHER type
|
||||
* further.
|
||||
* @var string|null A user definable association type, which can be described in the comment field, which
|
||||
* is used if the type is OTHER
|
||||
*/
|
||||
#[ORM\Column(type: Types::STRING, length: 255, nullable: true)]
|
||||
protected ?string $other_type = null;
|
||||
|
||||
/**
|
||||
* @var string|null A comment describing this association further.
|
||||
*/
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
protected ?string $comment = null;
|
||||
|
@ -113,5 +119,16 @@ class PartAssociation extends AbstractDBElement
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getOtherType(): ?string
|
||||
{
|
||||
return $this->other_type;
|
||||
}
|
||||
|
||||
public function setOtherType(?string $other_type): PartAssociation
|
||||
{
|
||||
$this->other_type = $other_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -46,6 +46,9 @@ class PartAssociationType extends AbstractType
|
|||
'choice_label' => fn(AssociationType $type) => $type->getTranslationKey(),
|
||||
'help' => 'part_association.edit.type.help',
|
||||
])
|
||||
->add('other_type', TextType::class, [
|
||||
'required' => false,
|
||||
])
|
||||
->add('comment', TextType::class, [
|
||||
'required' => false,
|
||||
'label' => 'part_association.edit.comment'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue