src/Entity/Suplier.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SuplierRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassSuplierRepository::class)]
  8. class Suplier
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $name "";
  16.     #[ORM\Column(length255)]
  17.     private ?string $email null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $phone null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $country null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $address null;
  24.     #[ORM\Column(length255)]
  25.     private ?string $FTP null;
  26.     #[ORM\Column(length255)]
  27.     private ?string $FTP_USER null;
  28.     #[ORM\Column(length255)]
  29.     private ?string $FTP_PASSWORD null;
  30.     #[ORM\OneToMany(mappedBy'suplier'targetEntityCategoryMatching::class, orphanRemovaltrue)]
  31.     private Collection $categoryMatching;
  32.     #[ORM\OneToMany(mappedBy'supplier'targetEntityProduct::class)]
  33.     private Collection $products;
  34.     public function __construct()
  35.     {
  36.         $this->categoryMatching = new ArrayCollection();
  37.         $this->products = new ArrayCollection();
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getName(): ?string
  44.     {
  45.         return $this->name;
  46.     }
  47.     public function setName(string $name): static
  48.     {
  49.         $this->name $name;
  50.         return $this;
  51.     }
  52.     public function getEmail(): ?string
  53.     {
  54.         return $this->email;
  55.     }
  56.     public function setEmail(string $email): static
  57.     {
  58.         $this->email $email;
  59.         return $this;
  60.     }
  61.     public function getPhone(): ?string
  62.     {
  63.         return $this->phone;
  64.     }
  65.     public function setPhone(string $phone): static
  66.     {
  67.         $this->phone $phone;
  68.         return $this;
  69.     }
  70.     public function getCountry(): ?string
  71.     {
  72.         return $this->country;
  73.     }
  74.     public function setCountry(string $country): static
  75.     {
  76.         $this->country $country;
  77.         return $this;
  78.     }
  79.     public function getAddress(): ?string
  80.     {
  81.         return $this->address;
  82.     }
  83.     public function setAddress(string $address): static
  84.     {
  85.         $this->address $address;
  86.         return $this;
  87.     }
  88.     public function getFTP(): ?string
  89.     {
  90.         return $this->FTP;
  91.     }
  92.     public function setFTP(string $FTP): static
  93.     {
  94.         $this->FTP $FTP;
  95.         return $this;
  96.     }
  97.     public function getFTPUSER(): ?string
  98.     {
  99.         return $this->FTP_USER;
  100.     }
  101.     public function setFTPUSER(string $FTP_USER): static
  102.     {
  103.         $this->FTP_USER $FTP_USER;
  104.         return $this;
  105.     }
  106.     public function getFTPPASSWORD(): ?string
  107.     {
  108.         return $this->FTP_PASSWORD;
  109.     }
  110.     public function setFTPPASSWORD(string $FTP_PASSWORD): static
  111.     {
  112.         $this->FTP_PASSWORD $FTP_PASSWORD;
  113.         return $this;
  114.     }
  115.     /**
  116.      * @return Collection<int, CategoryMatching>
  117.      */
  118.     public function getCategoryMatching(): Collection
  119.     {
  120.         return $this->categoryMatching;
  121.     }
  122.     public function addCategoryMatching(CategoryMatching $categoryMatching): static
  123.     {
  124.         if (!$this->categoryMatching->contains($categoryMatching)) {
  125.             $this->categoryMatching->add($categoryMatching);
  126.             $categoryMatching->setSuplier($this);
  127.         }
  128.         return $this;
  129.     }
  130.     public function removeCategoryMatching(CategoryMatching $categoryMatching): static
  131.     {
  132.         if ($this->categoryMatching->removeElement($categoryMatching)) {
  133.             // set the owning side to null (unless already changed)
  134.             if ($categoryMatching->getSuplier() === $this) {
  135.                 $categoryMatching->setSuplier(null);
  136.             }
  137.         }
  138.         return $this;
  139.     }
  140.     public function __toString() {
  141.         return $this->name;
  142.     }
  143.     /**
  144.      * @return Collection<int, Product>
  145.      */
  146.     public function getProducts(): Collection
  147.     {
  148.         return $this->products;
  149.     }
  150.     public function addProduct(Product $product): static
  151.     {
  152.         if (!$this->products->contains($product)) {
  153.             $this->products->add($product);
  154.             $product->setSupplier($this);
  155.         }
  156.         return $this;
  157.     }
  158.     public function removeProduct(Product $product): static
  159.     {
  160.         if ($this->products->removeElement($product)) {
  161.             // set the owning side to null (unless already changed)
  162.             if ($product->getSupplier() === $this) {
  163.                 $product->setSupplier(null);
  164.             }
  165.         }
  166.         return $this;
  167.     }
  168. }