You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
2.4KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Model\Section;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface;
  5. use Lc\SovBundle\Doctrine\EntityInterface;
  6. use Lc\SovBundle\Model\User\GroupUserInterface;
  7. /**
  8. * @ORM\MappedSuperclass()
  9. */
  10. abstract class OpeningModel implements EntityInterface, OpeningInterface, FilterSectionInterface
  11. {
  12. /**
  13. * @ORM\Column(type="integer")
  14. */
  15. protected $day;
  16. /**
  17. * @ORM\Column(type="time", nullable=true)
  18. */
  19. protected $timeStart;
  20. /**
  21. * @ORM\Column(type="time", nullable=true)
  22. */
  23. protected $timeEnd;
  24. /**
  25. * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface", inversedBy="openings")
  26. * @ORM\JoinColumn(nullable=false)
  27. */
  28. protected $section;
  29. /**
  30. * @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\GroupUserInterface", inversedBy="openings")
  31. */
  32. protected $groupUser;
  33. public function __toString()
  34. {
  35. $toString = ''.$this->getDay();
  36. if($this->getTimeStart()) {
  37. $toString .= ' / Début : '.$this->getTimeStart()->format('H:i');
  38. }
  39. if($this->getTimeEnd()) {
  40. $toString .= ' / Fin : '.$this->getTimeEnd()->format('H:i');
  41. }
  42. return $toString ;
  43. }
  44. public function getDay(): ?int
  45. {
  46. return $this->day;
  47. }
  48. public function setDay(int $day): self
  49. {
  50. $this->day = $day;
  51. return $this;
  52. }
  53. public function getTimeStart(): ?\DateTimeInterface
  54. {
  55. return $this->timeStart;
  56. }
  57. public function setTimeStart(?\DateTimeInterface $timeStart): self
  58. {
  59. $this->timeStart = $timeStart;
  60. return $this;
  61. }
  62. public function getTimeEnd(): ?\DateTimeInterface
  63. {
  64. return $this->timeEnd;
  65. }
  66. public function setTimeEnd(?\DateTimeInterface $timeEnd): self
  67. {
  68. $this->timeEnd = $timeEnd;
  69. return $this;
  70. }
  71. public function getSection(): ?SectionInterface
  72. {
  73. return $this->section;
  74. }
  75. public function setSection(?SectionInterface $section): self
  76. {
  77. $this->section = $section;
  78. return $this;
  79. }
  80. public function getGroupUser(): ?GroupUserInterface
  81. {
  82. return $this->groupUser;
  83. }
  84. public function setGroupUser(?GroupUserInterface $groupUser): self
  85. {
  86. $this->groupUser = $groupUser;
  87. return $this;
  88. }
  89. }