Feat: Add description field to availability
This commit is contained in:
@@ -31,6 +31,9 @@ class Availability implements BlameableEntityInterface, TimestampableEntityInter
|
||||
#[Assert\GreaterThan(propertyPath: 'dateFrom', message: 'Das Datum muss nach dem Beginndatum liegen')]
|
||||
private ?\DateTimeImmutable $dateTo = null;
|
||||
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $description = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'customAvailabilities')]
|
||||
private ?Teamer $owner = null;
|
||||
|
||||
@@ -76,6 +79,18 @@ class Availability implements BlameableEntityInterface, TimestampableEntityInter
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function setDescription(?string $description): static
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOwner(): ?Teamer
|
||||
{
|
||||
return $this->owner;
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Form;
|
||||
|
||||
use App\Entity\Availability;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
@@ -20,6 +21,10 @@ class AvailabilityType extends AbstractType
|
||||
'label' => 'Datum bis',
|
||||
'min_date' => new \DateTimeImmutable(),
|
||||
])
|
||||
->add('description', TextType::class, [
|
||||
'label' => 'Anmerkung',
|
||||
'required' => false,
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user