src/Entity/DayTime.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DayTimeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassDayTimeRepository::class)]
  8. class DayTime
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length45)]
  15.     private ?string $name null;
  16.     #[ORM\Column(length45)]
  17.     private ?string $start_at null;
  18.     #[ORM\Column(length45)]
  19.     private ?string $end_at null;
  20.     #[ORM\ManyToMany(targetEntityParkingMatrixRaw::class, mappedBy'daytime')]
  21.     private Collection $parkingMatrixRaws;
  22.     public function __construct()
  23.     {
  24.         $this->parkingMatrices = new ArrayCollection();
  25.         $this->parkingMatrixRaws = new ArrayCollection();
  26.     }
  27.     public function __toString()
  28.     {
  29.         return $this->name;
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getName(): ?string
  36.     {
  37.         return $this->name;
  38.     }
  39.     public function setName(string $name): static
  40.     {
  41.         $this->name $name;
  42.         return $this;
  43.     }
  44.     public function getStartAt(): ?string
  45.     {
  46.         return $this->start_at;
  47.     }
  48.     public function setStartAt(string $start_at): static
  49.     {
  50.         $this->start_at $start_at;
  51.         return $this;
  52.     }
  53.     public function getEndAt(): ?string
  54.     {
  55.         return $this->end_at;
  56.     }
  57.     public function setEndAt(string $end_at): static
  58.     {
  59.         $this->end_at $end_at;
  60.         return $this;
  61.     }
  62.     /**
  63.      * @return Collection<int, ParkingMatrixRaw>
  64.      */
  65.     public function getParkingMatrixRaws(): Collection
  66.     {
  67.         return $this->parkingMatrixRaws;
  68.     }
  69.     public function addParkingMatrixRaw(ParkingMatrixRaw $parkingMatrixRaw): static
  70.     {
  71.         if (!$this->parkingMatrixRaws->contains($parkingMatrixRaw)) {
  72.             $this->parkingMatrixRaws->add($parkingMatrixRaw);
  73.             $parkingMatrixRaw->addDaytime($this);
  74.         }
  75.         return $this;
  76.     }
  77.     public function removeParkingMatrixRaw(ParkingMatrixRaw $parkingMatrixRaw): static
  78.     {
  79.         if ($this->parkingMatrixRaws->removeElement($parkingMatrixRaw)) {
  80.             $parkingMatrixRaw->removeDaytime($this);
  81.         }
  82.         return $this;
  83.     }
  84. }