src/Entity/System/categories.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use App\Repository\System\categoriesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClasscategoriesRepository::class)]
  8. class categories
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string',length255nullabletrue)]
  15.     private $title;
  16.     #[ORM\Column(type'text'nullable:true)]
  17.     private $link;
  18.     #[ORM\Column(type'string',length255nullabletrue)]
  19.     private $icon;
  20.     #[ORM\Column(type'datetime'nullabletrue)]
  21.     private $created_at;
  22.     #[ORM\Column(type'datetime'nullabletrue)]
  23.     private $updated_at;
  24.     #[ORM\OneToMany(mappedBy'categories_id'targetEntitysubCategories::class)]
  25.     private $subCategories;
  26.     #[ORM\OneToMany(mappedBy'categories_id'targetEntityaccess::class)]
  27.     private $accesses;
  28.     public function __construct()
  29.     {
  30.         $this->subCategories = new ArrayCollection();
  31.         $this->accesses = new ArrayCollection();
  32.     }
  33.     public function setId(?int $id): self
  34.     {
  35.         $this->id $id;
  36.         return $this;
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getTitle(): ?string
  43.     {
  44.         return $this->title;
  45.     }
  46.     public function setTitle(?string $title): self
  47.     {
  48.         $this->title $title;
  49.         return $this;
  50.     }
  51.     public function getLink(): ?string
  52.     {
  53.         return $this->link;
  54.     }
  55.     public function setLink(?string $link): self
  56.     {
  57.         $this->link $link;
  58.         return $this;
  59.     }
  60.     public function getIcon(): ?string
  61.     {
  62.         return $this->icon;
  63.     }
  64.     public function setIcon(?string $icon): self
  65.     {
  66.         $this->icon $icon;
  67.         return $this;
  68.     }
  69.     public function getCreatedAt(): ?\DateTimeInterface
  70.     {
  71.         return $this->created_at;
  72.     }
  73.     public function setCreatedAt(?\DateTimeInterface $created_at): self
  74.     {
  75.         $this->created_at $created_at;
  76.         return $this;
  77.     }
  78.     public function getUpdatedAt(): ?\DateTimeInterface
  79.     {
  80.         return $this->updated_at;
  81.     }
  82.     public function setUpdatedAt(?\DateTimeInterface $updated_at): self
  83.     {
  84.         $this->updated_at $updated_at;
  85.         return $this;
  86.     }
  87.     /**
  88.      * @return Collection<int, subCategories>
  89.      */
  90.     public function getSubCategories(): Collection
  91.     {
  92.         return $this->subCategories;
  93.     }
  94.     public function addSubCategory(subCategories $subCategory): self
  95.     {
  96.         if (!$this->subCategories->contains($subCategory)) {
  97.             $this->subCategories[] = $subCategory;
  98.             $subCategory->setCategoriesId($this);
  99.         }
  100.         return $this;
  101.     }
  102.     public function removeSubCategory(subCategories $subCategory): self
  103.     {
  104.         if ($this->subCategories->removeElement($subCategory)) {
  105.             // set the owning side to null (unless already changed)
  106.             if ($subCategory->getCategoriesId() === $this) {
  107.                 $subCategory->setCategoriesId(null);
  108.             }
  109.         }
  110.         return $this;
  111.     }
  112.     /**
  113.      * @return Collection<int, access>
  114.      */
  115.     public function getAccesses(): Collection
  116.     {
  117.         return $this->accesses;
  118.     }
  119.     public function addAccess(access $access): self
  120.     {
  121.         if (!$this->accesses->contains($access)) {
  122.             $this->accesses[] = $access;
  123.             $access->setCategoriesId($this);
  124.         }
  125.         return $this;
  126.     }
  127.     public function removeAccess(access $access): self
  128.     {
  129.         if ($this->accesses->removeElement($access)) {
  130.             // set the owning side to null (unless already changed)
  131.             if ($access->getCategoriesId() === $this) {
  132.                 $access->setCategoriesId(null);
  133.             }
  134.         }
  135.         return $this;
  136.     }
  137. }