PeriodNotation.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. namespace AppBundle\Entity\Education;
  3. use AppBundle\Entity\Organization\Organization;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Dunglas\ApiBundle\Annotation\Iri;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use AppBundle\Entity\Traits\TimestampableEntity;
  9. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  10. /**
  11. * Période de notation
  12. *
  13. * (Non utilisée, à confirmer)
  14. *
  15. * @Iri("http://schema.org/PeriodNotation")
  16. */
  17. #[ORM\Entity]
  18. class PeriodNotation
  19. {
  20. use TimestampableEntity;
  21. use CreatorUpdaterEntity;
  22. /**
  23. * @var int
  24. */
  25. #[ORM\Column(type: 'integer')]
  26. #[ORM\Id]
  27. #[ORM\GeneratedValue(strategy: 'AUTO')]
  28. #[Groups(['periodnotation'])]
  29. private $id;
  30. /**
  31. * @var Organization
  32. */
  33. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Organization\Organization', inversedBy: 'periodNotations')]
  34. #[ORM\JoinColumn(nullable: false)]
  35. #[Assert\NotNull]
  36. #[Groups(['periodnotation'])]
  37. private $organization;
  38. /**
  39. * @var string
  40. */
  41. #[ORM\Column(type: 'string')]
  42. #[Assert\Type(type: 'string')]
  43. #[Assert\NotNull]
  44. #[Groups(['periodnotation'])]
  45. private $label;
  46. /**
  47. * Sets id.
  48. *
  49. * @param int $id
  50. *
  51. * @return $this
  52. */
  53. public function setId($id)
  54. {
  55. $this->id = $id;
  56. return $this;
  57. }
  58. /**
  59. * Gets id.
  60. *
  61. * @return int
  62. */
  63. public function getId()
  64. {
  65. return $this->id;
  66. }
  67. /**
  68. * Sets organization.
  69. *
  70. * @param Organization $organization
  71. *
  72. * @return $this
  73. */
  74. public function setOrganization(Organization $organization)
  75. {
  76. $this->organization = $organization;
  77. return $this;
  78. }
  79. /**
  80. * Gets organization.
  81. *
  82. * @return Organization
  83. */
  84. public function getOrganization()
  85. {
  86. return $this->organization;
  87. }
  88. /**
  89. * Sets label.
  90. *
  91. * @param string $label
  92. *
  93. * @return $this
  94. */
  95. public function setLabel($label)
  96. {
  97. $this->label = $label;
  98. return $this;
  99. }
  100. /**
  101. * Gets label.
  102. *
  103. * @return string
  104. */
  105. public function getLabel()
  106. {
  107. return $this->label;
  108. }
  109. }