src/Entity/TagGroups.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TagGroupsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TagGroupsRepository::class)
  9.  */
  10. class TagGroups
  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\ManyToMany(targetEntity=Articles::class, inversedBy="tagGroups")
  24.      */
  25.     private $articles;
  26.     /**
  27.      * @ORM\Column(type="boolean")
  28.      */
  29.     private $hidden false;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $color;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=ChildTags::class, mappedBy="tag")
  36.      */
  37.     private $childTags;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private $idPunch null;
  42.     /**
  43.      * @ORM\Column(type="datetime", nullable=true)
  44.      */
  45.     private $updatedAt;
  46.     /**
  47.      * @ORM\Column(type="integer", nullable=true)
  48.      */
  49.     private $numberToBuy 1;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity=Users::class, inversedBy="tagGroupsUpdate")
  52.      */
  53.     private $updatedBy;
  54.     public function __construct()
  55.     {
  56.         $this->articles = new ArrayCollection();
  57.         $this->childTags = new ArrayCollection();
  58.         $this->updatedAt = New \DateTime();
  59.     }
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getName(): ?string
  65.     {
  66.         return $this->name;
  67.     }
  68.     public function setName(string $name): self
  69.     {
  70.         $this->name $name;
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection<int, Articles>
  75.      */
  76.     public function getArticles(): Collection
  77.     {
  78.         return $this->articles;
  79.     }
  80.     public function addArticle(Articles $article): self
  81.     {
  82.         if (!$this->articles->contains($article)) {
  83.             $this->articles[] = $article;
  84.         }
  85.         return $this;
  86.     }
  87.     public function removeArticle(Articles $article): self
  88.     {
  89.         $this->articles->removeElement($article);
  90.         return $this;
  91.     }
  92.     public function isHidden(): ?bool
  93.     {
  94.         return $this->hidden;
  95.     }
  96.     public function setHidden(bool $hidden): self
  97.     {
  98.         $this->hidden $hidden;
  99.         return $this;
  100.     }
  101.     public function getColor(): ?string
  102.     {
  103.         return $this->color;
  104.     }
  105.     public function setColor(?string $color): self
  106.     {
  107.         $this->color $color;
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return Collection<int, ChildTags>
  112.      */
  113.     public function getChildTags(): Collection
  114.     {
  115.         return $this->childTags;
  116.     }
  117.     public function addChildTag(ChildTags $childTag): self
  118.     {
  119.         if (!$this->childTags->contains($childTag)) {
  120.             $this->childTags[] = $childTag;
  121.             $childTag->setTag($this);
  122.         }
  123.         return $this;
  124.     }
  125.     public function removeChildTag(ChildTags $childTag): self
  126.     {
  127.         if ($this->childTags->removeElement($childTag)) {
  128.             // set the owning side to null (unless already changed)
  129.             if ($childTag->getTag() === $this) {
  130.                 $childTag->setTag(null);
  131.             }
  132.         }
  133.         return $this;
  134.     }
  135.     public function getIdPunch(): ?string
  136.     {
  137.         return $this->idPunch;
  138.     }
  139.     public function setIdPunch(?string $idPunch): self
  140.     {
  141.         $this->idPunch $idPunch;
  142.         return $this;
  143.     }
  144.     public function getUpdatedAt(): ?\DateTimeInterface
  145.     {
  146.         return $this->updatedAt;
  147.     }
  148.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  149.     {
  150.         $this->updatedAt $updatedAt;
  151.         return $this;
  152.     }
  153.     public function getNumberToBuy(): ?int
  154.     {
  155.         return $this->numberToBuy;
  156.     }
  157.     public function setNumberToBuy(?int $numberToBuy): self
  158.     {
  159.         $this->numberToBuy $numberToBuy;
  160.         return $this;
  161.     }
  162.     public function getUpdatedBy(): ?Users
  163.     {
  164.         return $this->updatedBy;
  165.     }
  166.     public function setUpdatedBy(?Users $updatedBy): self
  167.     {
  168.         $this->updatedBy $updatedBy;
  169.         return $this;
  170.     }
  171. }