|
- <?php
-
- namespace Lc\CaracoleBundle\Model\Section;
-
- use Doctrine\ORM\Mapping as ORM;
- use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface;
- use Lc\SovBundle\Doctrine\EntityInterface;
- use Lc\SovBundle\Model\User\GroupUserInterface;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class OpeningModel implements EntityInterface, OpeningInterface, FilterSectionInterface
- {
- /**
- * @ORM\Column(type="integer")
- */
- protected $day;
-
- /**
- * @ORM\Column(type="time", nullable=true)
- */
- protected $timeStart;
-
- /**
- * @ORM\Column(type="time", nullable=true)
- */
- protected $timeEnd;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface", inversedBy="openings")
- * @ORM\JoinColumn(nullable=false)
- */
- protected $section;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\GroupUserInterface", inversedBy="openings")
- */
- protected $groupUser;
-
- public function __toString()
- {
- $toString = ''.$this->getDay();
-
- if($this->getTimeStart()) {
- $toString .= ' / Début : '.$this->getTimeStart()->format('H:i');
- }
-
- if($this->getTimeEnd()) {
- $toString .= ' / Fin : '.$this->getTimeEnd()->format('H:i');
- }
-
- return $toString ;
- }
-
- public function getDay(): ?int
- {
- return $this->day;
- }
-
- public function setDay(int $day): self
- {
- $this->day = $day;
-
- return $this;
- }
-
- public function getTimeStart(): ?\DateTimeInterface
- {
- return $this->timeStart;
- }
-
- public function setTimeStart(?\DateTimeInterface $timeStart): self
- {
- $this->timeStart = $timeStart;
-
- return $this;
- }
-
- public function getTimeEnd(): ?\DateTimeInterface
- {
- return $this->timeEnd;
- }
-
- public function setTimeEnd(?\DateTimeInterface $timeEnd): self
- {
- $this->timeEnd = $timeEnd;
-
- return $this;
- }
-
- public function getSection(): ?SectionInterface
- {
- return $this->section;
- }
-
- public function setSection(?SectionInterface $section): self
- {
- $this->section = $section;
-
- return $this;
- }
-
- public function getGroupUser(): ?GroupUserInterface
- {
- return $this->groupUser;
- }
-
- public function setGroupUser(?GroupUserInterface $groupUser): self
- {
- $this->groupUser = $groupUser;
-
- return $this;
- }
- }
|