ActivityYearTrait.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace AppBundle\Entity\Traits;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Dunglas\ApiBundle\Annotation\Iri;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. /**
  7. * @Iri("http://schema.org/Generic")
  8. */
  9. trait ActivityYearTrait
  10. {
  11. /**
  12. * @var int
  13. */
  14. #[ORM\Column(type: 'integer', nullable: true)]
  15. #[Groups(['educationstudent', 'access_details_educationstudent', 'report_card_educationstudent', 'student_registration_educationstudent', 'educationnotation_list_educationstudent', 'edu_stu_courses_courses', 'education_input_list', 'education_student_next_year', 'online_registration_access_details_educationstudent', 'education_student_next_year_educationstudentlastyear', 'organization_cotisation_steps_cotisationbyyears'])]
  16. private $startYear;
  17. /**
  18. * @var int
  19. */
  20. #[ORM\Column(type: 'integer', nullable: true)]
  21. #[Groups(['educationstudent', 'access_details_educationstudent', 'report_card_educationstudent', 'student_registration_educationstudent'])]
  22. private $endYear;
  23. /**
  24. * Gets start year
  25. *
  26. * @return int
  27. */
  28. public function getStartYear() {
  29. return $this->startYear;
  30. }
  31. /**
  32. * Sets start year
  33. *
  34. * @param int $startYear
  35. * @return $this
  36. */
  37. public function setStartYear($startYear = null) {
  38. if($startYear == null) $startYear = date('Y');
  39. $this->startYear = $startYear;
  40. return $this;
  41. }
  42. /**
  43. * Gets end year
  44. *
  45. * @return int
  46. */
  47. public function getEndYear() {
  48. return $this->endYear;
  49. }
  50. /**
  51. * Sets end year
  52. *
  53. * @param int $endYear
  54. * @return $this
  55. */
  56. public function setEndYear($endYear) {
  57. $this->endYear = $endYear;
  58. return $this;
  59. }
  60. }