[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

@@ -7,10 +7,14 @@ use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Entity\User;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
/**
* @ORM\Entity
* @ORM\Table("chill_person_accompanying_period_work_evaluation_document")
* @Serializer\DiscriminatorMap(typeProperty="type", mapping={
* "accompanying_period_work_evaluation_document"=AccompanyingPeriodWorkEvaluationDocument::class
* })
*/
class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doctrine\Model\TrackCreationInterface, \Chill\MainBundle\Doctrine\Model\TrackUpdateInterface
{
@@ -22,8 +26,10 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
*
* @internal the default name exceeds 64 characters, we must set manually:
* @ORM\SequenceGenerator(sequenceName="chill_person_social_work_eval_doc_id_seq", allocationSize=1, initialValue=1000)
* @Serializer\Groups({"read"})
*/
private ?int $id;
/**
* @var AccompanyingPeriodWorkEvaluation|null
* @ORM\ManyToOne(
@@ -37,11 +43,13 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
* @ORM\ManyToOne(
* targetEntity=User::class
* )
* @Serializer\Groups({"read"})
*/
private ?User $createdBy;
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
* @Serializer\Groups({"read"})
*/
private ?\DateTimeImmutable $createdAt;
@@ -49,11 +57,13 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
* @ORM\ManyToOne(
* targetEntity=User::class
* )
* @Serializer\Groups({"read"})
*/
private ?User $updatedBy;
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
* @Serializer\Groups({"read"})
*/
private ?DateTimeImmutable $updatedAt;
@@ -121,5 +131,44 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
return $this;
}
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @return User|null
*/
public function getCreatedBy(): ?User
{
return $this->createdBy;
}
/**
* @return \DateTimeImmutable|null
*/
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
/**
* @return User|null
*/
public function getUpdatedBy(): ?User
{
return $this->updatedBy;
}
/**
* @return DateTimeImmutable|null
*/
public function getUpdatedAt(): ?DateTimeInterface
{
return $this->updatedAt;
}
}