<?php
namespace App\Entity;
use App\Repository\DaysRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: DaysRepository::class)]
class Days
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 45)]
#[Assert\NotBlank]
private ?string $days = null;
#[ORM\ManyToMany(targetEntity: ParkingMatrixRaw::class, mappedBy: 'day')]
private Collection $parkingMatrixRaws;
public function __construct()
{
$this->parkingMatrices = new ArrayCollection();
$this->parkingMatrixRaws = new ArrayCollection();
}
public function __toString()
{
return $this->days;
}
public function getId(): ?int
{
return $this->id;
}
public function getDays(): ?string
{
return $this->days;
}
public function setDays(string $days): static
{
$this->days = $days;
return $this;
}
/**
* @return Collection<int, ParkingMatrixRaw>
*/
public function getParkingMatrixRaws(): Collection
{
return $this->parkingMatrixRaws;
}
public function addParkingMatrixRaw(ParkingMatrixRaw $parkingMatrixRaw): static
{
if (!$this->parkingMatrixRaws->contains($parkingMatrixRaw)) {
$this->parkingMatrixRaws->add($parkingMatrixRaw);
$parkingMatrixRaw->addDay($this);
}
return $this;
}
public function removeParkingMatrixRaw(ParkingMatrixRaw $parkingMatrixRaw): static
{
if ($this->parkingMatrixRaws->removeElement($parkingMatrixRaw)) {
$parkingMatrixRaw->removeDay($this);
}
return $this;
}
}