<?php
namespace App\Entity;
use App\Repository\DayTimeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: DayTimeRepository::class)]
class DayTime
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 45)]
private ?string $name = null;
#[ORM\Column(length: 45)]
private ?string $start_at = null;
#[ORM\Column(length: 45)]
private ?string $end_at = null;
#[ORM\ManyToMany(targetEntity: ParkingMatrixRaw::class, mappedBy: 'daytime')]
private Collection $parkingMatrixRaws;
public function __construct()
{
$this->parkingMatrices = new ArrayCollection();
$this->parkingMatrixRaws = new ArrayCollection();
}
public function __toString()
{
return $this->name;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getStartAt(): ?string
{
return $this->start_at;
}
public function setStartAt(string $start_at): static
{
$this->start_at = $start_at;
return $this;
}
public function getEndAt(): ?string
{
return $this->end_at;
}
public function setEndAt(string $end_at): static
{
$this->end_at = $end_at;
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->addDaytime($this);
}
return $this;
}
public function removeParkingMatrixRaw(ParkingMatrixRaw $parkingMatrixRaw): static
{
if ($this->parkingMatrixRaws->removeElement($parkingMatrixRaw)) {
$parkingMatrixRaw->removeDaytime($this);
}
return $this;
}
}