src/Entity/TarifCategory.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TarifCategoryRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TarifCategoryRepository::class)
  9.  */
  10. class TarifCategory
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=TarifsArticle::class, mappedBy="tarifCategory")
  24.      */
  25.     private $TarifsArticle;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=Establishments::class, mappedBy="tarifCategory")
  28.      */
  29.     private $establishments;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $idPunch null;
  34.     public function __construct()
  35.     {
  36.         $this->TarifsArticle = new ArrayCollection();
  37.         $this->establishments = new ArrayCollection();
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getName(): ?string
  44.     {
  45.         return $this->name;
  46.     }
  47.     public function setName(string $name): self
  48.     {
  49.         $this->name $name;
  50.         return $this;
  51.     }
  52.     /**
  53.      * @return Collection<int, TarifsArticle>
  54.      */
  55.     public function getTarifsArticle(): Collection
  56.     {
  57.         return $this->TarifsArticle;
  58.     }
  59.     public function addTarifsArticle(TarifsArticle $tarifsArticle): self
  60.     {
  61.         if (!$this->TarifsArticle->contains($tarifsArticle)) {
  62.             $this->TarifsArticle[] = $tarifsArticle;
  63.             $tarifsArticle->setTarifCategory($this);
  64.         }
  65.         return $this;
  66.     }
  67.     public function removeTarifsArticle(TarifsArticle $tarifsArticle): self
  68.     {
  69.         if ($this->TarifsArticle->removeElement($tarifsArticle)) {
  70.             // set the owning side to null (unless already changed)
  71.             if ($tarifsArticle->getTarifCategory() === $this) {
  72.                 $tarifsArticle->setTarifCategory(null);
  73.             }
  74.         }
  75.         return $this;
  76.     }
  77.     /**
  78.      * @return Collection<int, Establishments>
  79.      */
  80.     public function getEstablishments(): Collection
  81.     {
  82.         return $this->establishments;
  83.     }
  84.     public function addEstablishment(Establishments $establishment): self
  85.     {
  86.         if (!$this->establishments->contains($establishment)) {
  87.             $this->establishments[] = $establishment;
  88.             $establishment->setTarifCategory($this);
  89.         }
  90.         return $this;
  91.     }
  92.     public function removeEstablishment(Establishments $establishment): self
  93.     {
  94.         if ($this->establishments->removeElement($establishment)) {
  95.             // set the owning side to null (unless already changed)
  96.             if ($establishment->getTarifCategory() === $this) {
  97.                 $establishment->setTarifCategory(null);
  98.             }
  99.         }
  100.         return $this;
  101.     }
  102.     public function getIdPunch(): ?string
  103.     {
  104.         return $this->idPunch;
  105.     }
  106.     public function setIdPunch(?string $idPunch): self
  107.     {
  108.         $this->idPunch $idPunch;
  109.         return $this;
  110.     }
  111. }