src/Entity/Suplier.php line 11
<?php
namespace App\Entity;
use App\Repository\SuplierRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: SuplierRepository::class)]
class Suplier
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = "";
#[ORM\Column(length: 255)]
private ?string $email = null;
#[ORM\Column(length: 255)]
private ?string $phone = null;
#[ORM\Column(length: 255)]
private ?string $country = null;
#[ORM\Column(length: 255)]
private ?string $address = null;
#[ORM\Column(length: 255)]
private ?string $FTP = null;
#[ORM\Column(length: 255)]
private ?string $FTP_USER = null;
#[ORM\Column(length: 255)]
private ?string $FTP_PASSWORD = null;
#[ORM\OneToMany(mappedBy: 'suplier', targetEntity: CategoryMatching::class, orphanRemoval: true)]
private Collection $categoryMatching;
#[ORM\OneToMany(mappedBy: 'supplier', targetEntity: Product::class)]
private Collection $products;
public function __construct()
{
$this->categoryMatching = new ArrayCollection();
$this->products = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): static
{
$this->email = $email;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(string $phone): static
{
$this->phone = $phone;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(string $country): static
{
$this->country = $country;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(string $address): static
{
$this->address = $address;
return $this;
}
public function getFTP(): ?string
{
return $this->FTP;
}
public function setFTP(string $FTP): static
{
$this->FTP = $FTP;
return $this;
}
public function getFTPUSER(): ?string
{
return $this->FTP_USER;
}
public function setFTPUSER(string $FTP_USER): static
{
$this->FTP_USER = $FTP_USER;
return $this;
}
public function getFTPPASSWORD(): ?string
{
return $this->FTP_PASSWORD;
}
public function setFTPPASSWORD(string $FTP_PASSWORD): static
{
$this->FTP_PASSWORD = $FTP_PASSWORD;
return $this;
}
/**
* @return Collection<int, CategoryMatching>
*/
public function getCategoryMatching(): Collection
{
return $this->categoryMatching;
}
public function addCategoryMatching(CategoryMatching $categoryMatching): static
{
if (!$this->categoryMatching->contains($categoryMatching)) {
$this->categoryMatching->add($categoryMatching);
$categoryMatching->setSuplier($this);
}
return $this;
}
public function removeCategoryMatching(CategoryMatching $categoryMatching): static
{
if ($this->categoryMatching->removeElement($categoryMatching)) {
// set the owning side to null (unless already changed)
if ($categoryMatching->getSuplier() === $this) {
$categoryMatching->setSuplier(null);
}
}
return $this;
}
public function __toString() {
return $this->name;
}
/**
* @return Collection<int, Product>
*/
public function getProducts(): Collection
{
return $this->products;
}
public function addProduct(Product $product): static
{
if (!$this->products->contains($product)) {
$this->products->add($product);
$product->setSupplier($this);
}
return $this;
}
public function removeProduct(Product $product): static
{
if ($this->products->removeElement($product)) {
// set the owning side to null (unless already changed)
if ($product->getSupplier() === $this) {
$product->setSupplier(null);
}
}
return $this;
}
}