src/Entity/Days.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DaysRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassDaysRepository::class)]
  8. class Days
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length45)]
  15.     #[Assert\NotBlank]
  16.     private ?string $days null;
  17.     #[ORM\ManyToMany(targetEntityParkingMatrixRaw::class, mappedBy'day')]
  18.     private Collection $parkingMatrixRaws;
  19.     public function __construct()
  20.     {
  21.         $this->parkingMatrices = new ArrayCollection();
  22.         $this->parkingMatrixRaws = new ArrayCollection();
  23.     }
  24.     public function __toString()
  25.     {
  26.         return $this->days;
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getDays(): ?string
  33.     {
  34.         return $this->days;
  35.     }
  36.     public function setDays(string $days): static
  37.     {
  38.         $this->days $days;
  39.         return $this;
  40.     }
  41.     /**
  42.      * @return Collection<int, ParkingMatrixRaw>
  43.      */
  44.     public function getParkingMatrixRaws(): Collection
  45.     {
  46.         return $this->parkingMatrixRaws;
  47.     }
  48.     public function addParkingMatrixRaw(ParkingMatrixRaw $parkingMatrixRaw): static
  49.     {
  50.         if (!$this->parkingMatrixRaws->contains($parkingMatrixRaw)) {
  51.             $this->parkingMatrixRaws->add($parkingMatrixRaw);
  52.             $parkingMatrixRaw->addDay($this);
  53.         }
  54.         return $this;
  55.     }
  56.     public function removeParkingMatrixRaw(ParkingMatrixRaw $parkingMatrixRaw): static
  57.     {
  58.         if ($this->parkingMatrixRaws->removeElement($parkingMatrixRaw)) {
  59.             $parkingMatrixRaw->removeDay($this);
  60.         }
  61.         return $this;
  62.     }
  63. }