src/Entity/CategoryMatching.php line 12
<?php
namespace App\Entity;
use App\Repository\CategoryMatchingRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use phpDocumentor\Reflection\PseudoTypes\True_;
#[ORM\Entity(repositoryClass: CategoryMatchingRepository::class)]
class CategoryMatching
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column]
private ?int $api_id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\ManyToOne(inversedBy: 'categoryMatching',fetch:"EAGER")]
#[ORM\JoinColumn(nullable: false)]
private ?Suplier $suplier = null;
#[ORM\ManyToMany(targetEntity: Category::class, inversedBy: 'categoryMatchings')]
private Collection $categories;
#[ORM\Column(length: 255,nullable: true)]
private ?string $parentPath = null;
public function __construct()
{
$this->categories = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function getApiId(): ?int
{
return $this->api_id;
}
public function setApiId(int $api_id): static
{
$this->api_id = $api_id;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getSuplier(): ?Suplier
{
return $this->suplier;
}
public function setSuplier(?Suplier $suplier): static
{
$this->suplier = $suplier;
return $this;
}
/**
* @return Collection<int, Category>
*/
public function getCategories(): Collection
{
return $this->categories;
}
public function addCategory(Category $category): static
{
if (!$this->categories->contains($category)) {
$this->categories->add($category);
}
return $this;
}
public function removeCategory(Category $category): static
{
$this->categories->removeElement($category);
return $this;
}
public function getParentPath(): ?string
{
return $this->parentPath;
}
public function setParentPath(string $parentPath): static
{
$this->parentPath = $parentPath;
return $this;
}
}