src/Entity/System/subCategories.php line 12

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