src/Entity/OpeningTimes.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OpeningTimesRepository;
  4. use DateTimeImmutable;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. #[ORM\Entity(repositoryClassOpeningTimesRepository::class)]
  8. class OpeningTimes
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     #[Groups(['studio:read'])]
  14.     private ?int $id null;
  15.     #[ORM\Column]
  16.     #[Groups(['studio:read'])]
  17.     private array $montag = [];
  18.     #[ORM\Column]
  19.     #[Groups(['studio:read'])]
  20.     private array $dienstag = [];
  21.     #[ORM\Column]
  22.     #[Groups(['studio:read'])]
  23.     private array $mittwoch = [];
  24.     #[ORM\Column]
  25.     #[Groups(['studio:read'])]
  26.     private array $donnerstag = [];
  27.     #[ORM\Column]
  28.     #[Groups(['studio:read'])]
  29.     private array $freitag = [];
  30.     #[ORM\Column]
  31.     #[Groups(['studio:read'])]
  32.     private array $samstag = [];
  33.     #[ORM\Column]
  34.     #[Groups(['studio:read'])]
  35.     private array $sonntag = [];
  36.     #[ORM\Column(nullabletrue)]
  37.     #[Groups(['studio:read'])]
  38.     private ?bool $active null;
  39.     #[ORM\Column(options: ['default' => false])]
  40.     #[Groups(['studio:read'])]
  41.     private ?bool $open247 null;
  42.     #[ORM\Column(length255nullabletrue)]
  43.     #[Groups(['studio:read'])]
  44.     private ?string $info null;
  45.     #[ORM\Column(length255options: ['default' => 'Öffnungszeiten'])]
  46.     #[Groups(['studio:read'])]
  47.     private ?string $bezeichnung null;
  48.     #[ORM\Column(length255options: ['default' => 'Nutzung 24 Stunden an 7 Tagen in der Woche möglich.'])]
  49.     #[Groups(['studio:read'])]
  50.     private ?string $text247 null;
  51.     #[ORM\OneToOne(mappedBy'openingTimes'targetEntityStudio::class)]
  52.     protected ?Studio $studio;
  53.     #[ORM\Column]
  54.     private ?DateTimeImmutable $createdAt null;
  55.     public function __construct()
  56.     {
  57.         $this->montag = [];
  58.         $this->dienstag = [];
  59.         $this->mittwoch = [];
  60.         $this->donnerstag = [];
  61.         $this->freitag = [];
  62.         $this->samstag = [];
  63.         $this->sonntag = [];
  64.         $this->active false;
  65.         $this->bezeichnung 'Öffnungszeiten';
  66.         $this->text247 'Nutzung 24 Stunden an 7 Tagen in der Woche möglich.';
  67.         $this->open247 false;
  68.         $this->createdAt = new DateTimeImmutable();
  69.     }
  70.     public function getId(): ?int
  71.     {
  72.         return $this->id;
  73.     }
  74.     public function getMontag(): array
  75.     {
  76.         return $this->montag;
  77.     }
  78.     public function setMontag(array $montag): self
  79.     {
  80.         $this->montag $montag;
  81.         return $this;
  82.     }
  83.     public function getDienstag(): array
  84.     {
  85.         return $this->dienstag;
  86.     }
  87.     public function setDienstag(array $dienstag): self
  88.     {
  89.         $this->dienstag $dienstag;
  90.         return $this;
  91.     }
  92.     public function getMittwoch(): array
  93.     {
  94.         return $this->mittwoch;
  95.     }
  96.     public function setMittwoch(array $mittwoch): self
  97.     {
  98.         $this->mittwoch $mittwoch;
  99.         return $this;
  100.     }
  101.     public function getDonnerstag(): array
  102.     {
  103.         return $this->donnerstag;
  104.     }
  105.     public function setDonnerstag(array $donnerstag): self
  106.     {
  107.         $this->donnerstag $donnerstag;
  108.         return $this;
  109.     }
  110.     public function getFreitag(): array
  111.     {
  112.         return $this->freitag;
  113.     }
  114.     public function setFreitag(array $freitag): self
  115.     {
  116.         $this->freitag $freitag;
  117.         return $this;
  118.     }
  119.     public function getSamstag(): array
  120.     {
  121.         return $this->samstag;
  122.     }
  123.     public function setSamstag(array $samstag): self
  124.     {
  125.         $this->samstag $samstag;
  126.         return $this;
  127.     }
  128.     public function getSonntag(): array
  129.     {
  130.         return $this->sonntag;
  131.     }
  132.     public function setSonntag(array $sonntag): self
  133.     {
  134.         $this->sonntag $sonntag;
  135.         return $this;
  136.     }
  137.     public function isActive(): ?bool
  138.     {
  139.         return $this->active;
  140.     }
  141.     public function setActive(?bool $active): self
  142.     {
  143.         $this->active $active;
  144.         return $this;
  145.     }
  146.     public function isOpen247(): ?bool
  147.     {
  148.         return $this->open247;
  149.     }
  150.     public function setOpen247(bool $open247): self
  151.     {
  152.         $this->open247 $open247;
  153.         return $this;
  154.     }
  155.     public function getInfo(): ?string
  156.     {
  157.         return $this->info;
  158.     }
  159.     public function setInfo(?string $info): self
  160.     {
  161.         $this->info $info;
  162.         return $this;
  163.     }
  164.     public function getBezeichnung(): ?string
  165.     {
  166.         return $this->bezeichnung;
  167.     }
  168.     public function setBezeichnung(?string $bezeichnung): self
  169.     {
  170.         $this->bezeichnung $bezeichnung;
  171.         return $this;
  172.     }
  173.     public function getText247(): ?string
  174.     {
  175.         return $this->text247;
  176.     }
  177.     public function setText247(?string $text247): self
  178.     {
  179.         $this->text247 $text247;
  180.         return $this;
  181.     }
  182.     public function getStudio(): ?Studio
  183.     {
  184.         return $this->studio;
  185.     }
  186.     public function setStudio(?Studio $studio): self
  187.     {
  188.         // unset the owning side of the relation if necessary
  189.         if ($studio === null && $this->studio !== null) {
  190.             $this->studio->setOpeningTimes(null);
  191.         }
  192.         // set the owning side of the relation if necessary
  193.         if ($studio !== null && $studio->getOpeningTimes() !== $this) {
  194.             $studio->setOpeningTimes($this);
  195.         }
  196.         $this->studio $studio;
  197.         return $this;
  198.     }
  199.     public function getCreatedAt(): ?DateTimeImmutable
  200.     {
  201.         return $this->createdAt;
  202.     }
  203.     public function setCreatedAt(DateTimeImmutable $createdAt): self
  204.     {
  205.         $this->createdAt $createdAt;
  206.         return $this;
  207.     }
  208. }