normalization for docgen:read: add groups and so on (wip)

This commit is contained in:
2021-12-06 13:18:59 +01:00
parent 51fd81c661
commit c4998f4ac1
15 changed files with 166 additions and 70 deletions

View File

@@ -32,38 +32,38 @@ class AccompanyingPeriodParticipation
* @ORM\ManyToOne(targetEntity=AccompanyingPeriod::class, inversedBy="participations", cascade={"persist"})
* @ORM\JoinColumn(name="accompanyingperiod_id", referencedColumnName="id", nullable=false)
*/
private $accompanyingPeriod;
private ?AccompanyingPeriod $accompanyingPeriod = null;
/**
* @ORM\Column(type="date", nullable=true)
* @Groups({"read", "read:docgen"})
* @Groups({"read", "docgen:read"})
*/
private $endDate;
private ?\DateTime $endDate = null;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"read", "read:docgen"})
* @Groups({"read", "docgen:read"})
*/
private $id;
private ?int $id = null;
/**
* @ORM\ManyToOne(targetEntity=Person::class, inversedBy="accompanyingPeriodParticipations")
* @ORM\JoinColumn(name="person_id", referencedColumnName="id", nullable=false)
* @Groups({"read", "read:docgen"})
* @Groups({"read", "docgen:read"})
*/
private $person;
private ?Person $person = null;
/**
* @ORM\Column(type="date", nullable=false)
* @Groups({"read"})
* @Groups({"read", "docgen:read"})
*/
private $startDate;
private ?\DateTime $startDate = null;
public function __construct(AccompanyingPeriod $accompanyingPeriod, Person $person)
{
$this->startDate = new DateTimeImmutable('now');
$this->startDate = new \DateTime('now');
$this->accompanyingPeriod = $accompanyingPeriod;
$this->person = $person;
}
@@ -73,10 +73,6 @@ class AccompanyingPeriodParticipation
return $this->accompanyingPeriod;
}
/*
* public function setStartDate(\DateTimeInterface $startDate): self { $this->startDate = $startDate; return $this; }
*/
public function getEndDate(): ?DateTimeInterface
{
return $this->endDate;