<?php
namespace App\Entity;
use App\Repository\TarifCategoryRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TarifCategoryRepository::class)
*/
class TarifCategory
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\OneToMany(targetEntity=TarifsArticle::class, mappedBy="tarifCategory")
*/
private $TarifsArticle;
/**
* @ORM\OneToMany(targetEntity=Establishments::class, mappedBy="tarifCategory")
*/
private $establishments;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $idPunch = null;
public function __construct()
{
$this->TarifsArticle = new ArrayCollection();
$this->establishments = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return Collection<int, TarifsArticle>
*/
public function getTarifsArticle(): Collection
{
return $this->TarifsArticle;
}
public function addTarifsArticle(TarifsArticle $tarifsArticle): self
{
if (!$this->TarifsArticle->contains($tarifsArticle)) {
$this->TarifsArticle[] = $tarifsArticle;
$tarifsArticle->setTarifCategory($this);
}
return $this;
}
public function removeTarifsArticle(TarifsArticle $tarifsArticle): self
{
if ($this->TarifsArticle->removeElement($tarifsArticle)) {
// set the owning side to null (unless already changed)
if ($tarifsArticle->getTarifCategory() === $this) {
$tarifsArticle->setTarifCategory(null);
}
}
return $this;
}
/**
* @return Collection<int, Establishments>
*/
public function getEstablishments(): Collection
{
return $this->establishments;
}
public function addEstablishment(Establishments $establishment): self
{
if (!$this->establishments->contains($establishment)) {
$this->establishments[] = $establishment;
$establishment->setTarifCategory($this);
}
return $this;
}
public function removeEstablishment(Establishments $establishment): self
{
if ($this->establishments->removeElement($establishment)) {
// set the owning side to null (unless already changed)
if ($establishment->getTarifCategory() === $this) {
$establishment->setTarifCategory(null);
}
}
return $this;
}
public function getIdPunch(): ?string
{
return $this->idPunch;
}
public function setIdPunch(?string $idPunch): self
{
$this->idPunch = $idPunch;
return $this;
}
}