<?php
namespace App\Entity;
use App\Repository\TagGroupsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TagGroupsRepository::class)
*/
class TagGroups
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\ManyToMany(targetEntity=Articles::class, inversedBy="tagGroups")
*/
private $articles;
/**
* @ORM\Column(type="boolean")
*/
private $hidden = false;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $color;
/**
* @ORM\OneToMany(targetEntity=ChildTags::class, mappedBy="tag")
*/
private $childTags;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $idPunch = null;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $numberToBuy = 1;
/**
* @ORM\ManyToOne(targetEntity=Users::class, inversedBy="tagGroupsUpdate")
*/
private $updatedBy;
public function __construct()
{
$this->articles = new ArrayCollection();
$this->childTags = new ArrayCollection();
$this->updatedAt = New \DateTime();
}
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, Articles>
*/
public function getArticles(): Collection
{
return $this->articles;
}
public function addArticle(Articles $article): self
{
if (!$this->articles->contains($article)) {
$this->articles[] = $article;
}
return $this;
}
public function removeArticle(Articles $article): self
{
$this->articles->removeElement($article);
return $this;
}
public function isHidden(): ?bool
{
return $this->hidden;
}
public function setHidden(bool $hidden): self
{
$this->hidden = $hidden;
return $this;
}
public function getColor(): ?string
{
return $this->color;
}
public function setColor(?string $color): self
{
$this->color = $color;
return $this;
}
/**
* @return Collection<int, ChildTags>
*/
public function getChildTags(): Collection
{
return $this->childTags;
}
public function addChildTag(ChildTags $childTag): self
{
if (!$this->childTags->contains($childTag)) {
$this->childTags[] = $childTag;
$childTag->setTag($this);
}
return $this;
}
public function removeChildTag(ChildTags $childTag): self
{
if ($this->childTags->removeElement($childTag)) {
// set the owning side to null (unless already changed)
if ($childTag->getTag() === $this) {
$childTag->setTag(null);
}
}
return $this;
}
public function getIdPunch(): ?string
{
return $this->idPunch;
}
public function setIdPunch(?string $idPunch): self
{
$this->idPunch = $idPunch;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getNumberToBuy(): ?int
{
return $this->numberToBuy;
}
public function setNumberToBuy(?int $numberToBuy): self
{
$this->numberToBuy = $numberToBuy;
return $this;
}
public function getUpdatedBy(): ?Users
{
return $this->updatedBy;
}
public function setUpdatedBy(?Users $updatedBy): self
{
$this->updatedBy = $updatedBy;
return $this;
}
}