Feat: Make fees editable, duplicatable and add internal name
This commit is contained in:
@@ -27,6 +27,22 @@ class Fee implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
#[Assert\NotBlank(message: 'Bitte gib die Bezeichnung an')]
|
||||
private ?string $name = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[Assert\NotBlank(message: 'Bitte gib die interne Bezeichnung an')]
|
||||
private ?string $nameInternal = null;
|
||||
|
||||
public static function duplicate(Fee $fee): static
|
||||
{
|
||||
$instance = new static();
|
||||
$instance
|
||||
->setName($fee->getName())
|
||||
->setNameInternal($fee->getNameInternal())
|
||||
->setValue($fee->getValue())
|
||||
;
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
@@ -55,4 +71,16 @@ class Fee implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNameInternal(): ?string
|
||||
{
|
||||
return $this->nameInternal;
|
||||
}
|
||||
|
||||
public function setNameInternal(?string $nameInternal): static
|
||||
{
|
||||
$this->nameInternal = $nameInternal;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user