src/Entity/CategoryMatching.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CategoryMatchingRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use phpDocumentor\Reflection\PseudoTypes\True_;
  8. #[ORM\Entity(repositoryClassCategoryMatchingRepository::class)]
  9. class CategoryMatching
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column]
  16.     private ?int $api_id null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $name null;
  19.     #[ORM\ManyToOne(inversedBy'categoryMatching',fetch:"EAGER")]
  20.     #[ORM\JoinColumn(nullablefalse)]
  21.     private ?Suplier $suplier null;
  22.     #[ORM\ManyToMany(targetEntityCategory::class, inversedBy'categoryMatchings')]
  23.     private Collection $categories;
  24.     #[ORM\Column(length255,nullabletrue)]
  25.     private ?string $parentPath null;
  26.     public function __construct()
  27.     {
  28.         $this->categories = new ArrayCollection();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function setId($id)
  35.     {
  36.          $this->id $id;
  37.          return $this;
  38.     }
  39.     public function getApiId(): ?int
  40.     {
  41.         return $this->api_id;
  42.     }
  43.     public function setApiId(int $api_id): static
  44.     {
  45.         $this->api_id $api_id;
  46.         return $this;
  47.     }
  48.     public function getName(): ?string
  49.     {
  50.         return $this->name;
  51.     }
  52.     public function setName(string $name): static
  53.     {
  54.         $this->name $name;
  55.         return $this;
  56.     }
  57.     public function getSuplier(): ?Suplier
  58.     {
  59.         return $this->suplier;
  60.     }
  61.     public function setSuplier(?Suplier $suplier): static
  62.     {
  63.         $this->suplier $suplier;
  64.         return $this;
  65.     }
  66.     /**
  67.      * @return Collection<int, Category>
  68.      */
  69.     public function getCategories(): Collection
  70.     {
  71.         return $this->categories;
  72.     }
  73.     public function addCategory(Category $category): static
  74.     {
  75.         if (!$this->categories->contains($category)) {
  76.             $this->categories->add($category);
  77.         }
  78.         return $this;
  79.     }
  80.     public function removeCategory(Category $category): static
  81.     {
  82.         $this->categories->removeElement($category);
  83.         return $this;
  84.     }
  85.     public function getParentPath(): ?string
  86.     {
  87.         return $this->parentPath;
  88.     }
  89.     public function setParentPath(string $parentPath): static
  90.     {
  91.         $this->parentPath $parentPath;
  92.         return $this;
  93.     }
  94. }