SeizurePeriodNotation.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. namespace AppBundle\Entity\Education;
  3. use AppBundle\Entity\AccessAndFunction\Access;
  4. use AppBundle\Entity\Organization\Organization;
  5. use AppBundle\Entity\Traits\ActivityPeriodTrait;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Dunglas\ApiBundle\Annotation\Iri;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. use AppBundle\Entity\Traits\TimestampableEntity;
  11. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  12. /**
  13. * Période de droit de saisir des notes pour un Access et une Education
  14. *
  15. * @Iri("http://schema.org/SeizurePeriodNotation")
  16. */
  17. #[ORM\Entity]
  18. class SeizurePeriodNotation
  19. {
  20. use TimestampableEntity;
  21. use CreatorUpdaterEntity;
  22. use ActivityPeriodTrait;
  23. /**
  24. * @var int
  25. */
  26. #[ORM\Column(type: 'integer')]
  27. #[ORM\Id]
  28. #[ORM\GeneratedValue(strategy: 'AUTO')]
  29. #[Groups(['seizureperiodnotation'])]
  30. private $id;
  31. /**
  32. * @var EducationTeacher
  33. */
  34. #[ORM\ManyToOne(targetEntity: 'EducationTeacher', inversedBy: 'seizurePeriodNotations')]
  35. #[Groups(['seizureperiodnotation'])]
  36. private $educationTeacher;
  37. /**
  38. * @var string
  39. */
  40. #[Groups(['seizureperiodnotation'])]
  41. private $fullLabelTemplate;
  42. /**
  43. * Sets id.
  44. *
  45. * @param int $id
  46. *
  47. * @return $this
  48. */
  49. public function setId($id)
  50. {
  51. $this->id = $id;
  52. return $this;
  53. }
  54. /**
  55. * Gets id.
  56. *
  57. * @return int
  58. */
  59. public function getId()
  60. {
  61. return $this->id;
  62. }
  63. /**
  64. * Set educationTeacher
  65. *
  66. * @param \AppBundle\Entity\Education\EducationTeacher $educationTeacher
  67. *
  68. * @return SeizurePeriodNotation
  69. */
  70. public function setEducationTeacher(\AppBundle\Entity\Education\EducationTeacher $educationTeacher)
  71. {
  72. $this->educationTeacher = $educationTeacher;
  73. return $this;
  74. }
  75. /**
  76. * Get educationTeacher
  77. *
  78. * @return \AppBundle\Entity\Education\EducationTeacher
  79. */
  80. public function getEducationTeacher()
  81. {
  82. return $this->educationTeacher;
  83. }
  84. /**
  85. * Gets full label.
  86. *
  87. * @return string
  88. */
  89. public function getFullLabelTemplate()
  90. {
  91. $startDate = new \DateTime($this->getStartDate());
  92. $endDate = new \DateTime($this->getEndDate());
  93. return [
  94. $startDate->format('d-m-Y'),
  95. 'to',
  96. $endDate->format('d-m-Y')
  97. ];
  98. }
  99. }