CotisationByYear.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. namespace AppBundle\Entity\Organization;
  3. use AppBundle\Entity\Traits\ActivityYearTrait;
  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. *
  12. * @Iri("http://schema.org/CotisationByYear")
  13. */
  14. #[ORM\Entity]
  15. class CotisationByYear
  16. {
  17. use TimestampableEntity;
  18. use CreatorUpdaterEntity;
  19. use ActivityYearTrait;
  20. /**
  21. * @var int
  22. */
  23. #[ORM\Column(type: 'integer')]
  24. #[ORM\Id]
  25. #[ORM\GeneratedValue(strategy: 'AUTO')]
  26. #[Groups(['cotisationbyyear', 'organization_cotisation_steps'])]
  27. private $id;
  28. /**
  29. * @var Organization
  30. */
  31. #[ORM\ManyToOne(targetEntity: 'Organization', inversedBy: 'cotisationByYears')]
  32. #[ORM\JoinColumn(name: 'organization_id', referencedColumnName: 'id', nullable: false)]
  33. #[Assert\NotNull]
  34. #[Groups(['cotisationbyyear'])]
  35. private $organization;
  36. /**
  37. * @var Organization
  38. */
  39. #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\Organization\CotisationStaffInfos', mappedBy: 'cotisationByYear', orphanRemoval: true, cascade: ['persist'], fetch: 'EAGER')]
  40. #[Groups(['cotisationbyyear', 'organization_cotisation_steps_cotisationbyyears'])]
  41. private $cotisationStaffInfos;
  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 organization
  65. *
  66. * @param \AppBundle\Entity\Organization\Organization $organization
  67. *
  68. * @return CotisationByYear
  69. */
  70. public function setOrganization(\AppBundle\Entity\Organization\Organization $organization)
  71. {
  72. $this->organization = $organization;
  73. return $this;
  74. }
  75. /**
  76. * Get organization
  77. *
  78. * @return \AppBundle\Entity\Organization\Organization
  79. */
  80. public function getOrganization()
  81. {
  82. return $this->organization;
  83. }
  84. /**
  85. * Set cotisationStaffInfos
  86. *
  87. * @param \AppBundle\Entity\Organization\CotisationStaffInfos $cotisationStaffInfos
  88. *
  89. * @return CotisationByYear
  90. */
  91. public function setCotisationStaffInfos(\AppBundle\Entity\Organization\CotisationStaffInfos $cotisationStaffInfos = null)
  92. {
  93. $cotisationStaffInfos->setCotisationByYear($this);
  94. $this->cotisationStaffInfos = $cotisationStaffInfos;
  95. return $this;
  96. }
  97. /**
  98. * Get cotisationStaffInfos
  99. *
  100. * @return \AppBundle\Entity\Organization\CotisationStaffInfos
  101. */
  102. public function getCotisationStaffInfos()
  103. {
  104. return $this->cotisationStaffInfos;
  105. }
  106. }