src/Entity/QrcodeCategories.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\QrcodeCategoriesRepository;
  4. use Arrayy\Collection\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Uid\Ulid;
  8. /**
  9.  * QrcodeCategories
  10.  *
  11.  */
  12. #[ORM\Table(name'QrcodeCategories')]
  13. #[ORM\Entity(repositoryClassQrcodeCategoriesRepository::class)]
  14. class QrcodeCategories
  15. {
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column(type'integer')]
  19.     private $id;
  20.     #[ORM\Column(type'string'length255)]
  21.     private $name;
  22.     #[ORM\OneToMany(targetEntity'Qrcode'mappedBy'categories')]
  23.     private $qrcode;
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getName(): ?string
  29.     {
  30.         return $this->name;
  31.     }
  32.     public function setName(?string $name): self
  33.     {
  34.         $this->name $name;
  35.         return $this;
  36.     }
  37.     /**
  38.      * @return Collection|QrcodeCategories[]
  39.      */
  40.     public function getcategories(): Collection
  41.     {
  42.         return $this->qrcode;
  43.     }
  44.     public function addcategories(Qrcode $qrcode): self
  45.     {
  46.         if (!$this->qrcode->contains($qrcode)) {
  47.             $this->qrcode[] = $qrcode;
  48.             $qrcode->setcategories($this);
  49.         }
  50.         return $this;
  51.     }
  52.     public function removecategories(Qrcode $qrcode): self
  53.     {
  54.         if ($this->qrcode->removeElement($qrcode)) {
  55.             // set the owning side to null (unless already changed)
  56.             if ($qrcode->getcategories() === $this) {
  57.                 $qrcode->setcategories(null);
  58.             }
  59.         }
  60.         return $this;
  61.     }
  62. }