[accompanyingPeriodWork] add evaluation to normalizer

This commit is contained in:
2021-08-02 00:13:08 +02:00
committed by Marc Ducobu
parent 6544566c34
commit 5635d19252
5 changed files with 297 additions and 13 deletions

View File

@@ -164,8 +164,12 @@ use Symfony\Component\Validator\Constraints as Assert;
* @var Collection
* @ORM\OneToMany(
* targetEntity=AccompanyingPeriodWorkEvaluation::class,
* mappedBy="accompanyingPeriodWork"
* mappedBy="accompanyingPeriodWork",
* cascade={"persist"},
* orphanRemoval=true
* )
* @Serializer\Groups({"read"})
* @internal /!\ the serialization for read / write evaluations is handled in `AccompanyingPeriodWorkDenormalizer`
*/
private Collection $accompanyingPeriodWorkEvaluations;
@@ -398,6 +402,11 @@ use Symfony\Component\Validator\Constraints as Assert;
return $this->thirdParties;
}
public function getThirdPartys(): Collection
{
return $this->getThirdParties();
}
public function addThirdParty(ThirdParty $thirdParty): self
{
if (!$this->thirdParties->contains($thirdParty)) {
@@ -434,4 +443,31 @@ use Symfony\Component\Validator\Constraints as Assert;
return $this;
}
/**
* @return Collection
*/
public function getAccompanyingPeriodWorkEvaluations()
{
return $this->accompanyingPeriodWorkEvaluations;
}
public function addAccompanyingPeriodWorkEvaluation(AccompanyingPeriodWorkEvaluation $evaluation): self
{
if (!$this->accompanyingPeriodWorkEvaluations->contains($evaluation)) {
$this->accompanyingPeriodWorkEvaluations[] = $evaluation;
$evaluation->setAccompanyingPeriodWork($this);
}
return $this;
}
public function removeAccompanyingPeriodWorkEvaluation(AccompanyingPeriodWorkEvaluation $evaluation): self
{
$this->accompanyingPeriodWorkEvaluations
->removeElement($evaluation);
$evaluation->setAccompanyingPeriodWork(null);
return $this;
}
}