<?php
namespace App\Entity;
use App\Repository\QrcodeCategoriesRepository;
use Arrayy\Collection\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Ulid;
/**
* QrcodeCategories
*
*/
#[ORM\Table(name: 'QrcodeCategories')]
#[ORM\Entity(repositoryClass: QrcodeCategoriesRepository::class)]
class QrcodeCategories
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $name;
#[ORM\OneToMany(targetEntity: 'Qrcode', mappedBy: 'categories')]
private $qrcode;
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|QrcodeCategories[]
*/
public function getcategories(): Collection
{
return $this->qrcode;
}
public function addcategories(Qrcode $qrcode): self
{
if (!$this->qrcode->contains($qrcode)) {
$this->qrcode[] = $qrcode;
$qrcode->setcategories($this);
}
return $this;
}
public function removecategories(Qrcode $qrcode): self
{
if ($this->qrcode->removeElement($qrcode)) {
// set the owning side to null (unless already changed)
if ($qrcode->getcategories() === $this) {
$qrcode->setcategories(null);
}
}
return $this;
}
}