src/Supplier/Doctrine/Entity/Product.php line 21

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Supplier\Doctrine\Entity;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping\Column;
  6. use Doctrine\ORM\Mapping\Entity;
  7. use Doctrine\ORM\Mapping\GeneratedValue;
  8. use Doctrine\ORM\Mapping\Id;
  9. use Doctrine\ORM\Mapping\Index;
  10. use Doctrine\ORM\Mapping\JoinColumn;
  11. use Doctrine\ORM\Mapping\ManyToOne;
  12. use Doctrine\ORM\Mapping\Table;
  13. #[Entity]
  14. #[Table(name'`supplier_product`')]
  15. #[Index(columns: ['reference'], name'reference')]
  16. #[Index(columns: ['new''supplier_id'], name'new_supplier_id')]
  17. class Product
  18. {
  19.     #[Id]
  20.     #[Column(type'integer')]
  21.     #[GeneratedValue]
  22.     private ?int $id null;
  23.     #[ManyToOne(targetEntitySupplier::class)]
  24.     #[JoinColumn(nullable:false)]
  25.     private Supplier $supplier;
  26.     #[Column]
  27.     private string $reference;
  28.     #[Column]
  29.     private string $name;
  30.     #[Column(type'text')]
  31.     private string $description;
  32.     #[Column(nullabletruetype'text')]
  33.     private ?string $image null;
  34.     #[Column]
  35.     private string $brand;
  36.     #[Column]
  37.     private string $taxonomy;
  38.     #[Column]
  39.     private int $purchasePrice;
  40.     #[Column]
  41.     private int $retailPrice;
  42.     #[Column(type'integer'options: ['default' => 0])]
  43.     private int $shippingCosts;
  44.     #[Column]
  45.     private int $ecoTax;
  46.     #[Column]
  47.     private float $vatRate;
  48.     #[Column]
  49.     private int $stock 0;
  50.     #[Column]
  51.     private bool $new false;
  52.     #[Column(type'datetime'nullabletrue)]
  53.     private ?DateTime $creationDate null;
  54.     #[Column(nullabletrue)]
  55.     private string $shippingMode;
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getSupplier(): Supplier
  61.     {
  62.         return $this->supplier;
  63.     }
  64.     public function setSupplier(Supplier $supplier): void
  65.     {
  66.         $this->supplier $supplier;
  67.     }
  68.     public function getReference(): string
  69.     {
  70.         return $this->reference;
  71.     }
  72.     public function setReference(string $reference): void
  73.     {
  74.         $this->reference $reference;
  75.     }
  76.     public function getName(): string
  77.     {
  78.         return $this->name;
  79.     }
  80.     public function setName(string $name): void
  81.     {
  82.         $this->name $name;
  83.     }
  84.     public function getDescription(): string
  85.     {
  86.         return $this->description;
  87.     }
  88.     public function setDescription(string $description): void
  89.     {
  90.         $this->description $description;
  91.     }
  92.     public function getImage(): ?string
  93.     {
  94.         return $this->image;
  95.     }
  96.     public function setImage(?string $image): void
  97.     {
  98.         $this->image $image;
  99.     }
  100.     public function getBrand(): string
  101.     {
  102.         return $this->brand;
  103.     }
  104.     public function setBrand(string $brand): void
  105.     {
  106.         $this->brand $brand;
  107.     }
  108.     public function getTaxonomy(): string
  109.     {
  110.         return $this->taxonomy;
  111.     }
  112.     public function setTaxonomy(string $taxonomy): void
  113.     {
  114.         $this->taxonomy $taxonomy;
  115.     }
  116.     public function getPurchasePrice(): int
  117.     {
  118.         return $this->purchasePrice;
  119.     }
  120.     public function setPurchasePrice(int $purchasePrice): void
  121.     {
  122.         $this->purchasePrice $purchasePrice;
  123.     }
  124.     public function getRetailPrice(): int
  125.     {
  126.         return $this->retailPrice;
  127.     }
  128.     public function setRetailPrice(int $retailPrice): void
  129.     {
  130.         $this->retailPrice $retailPrice;
  131.     }
  132.     public function getShippingCosts(): int
  133.     {
  134.         return $this->shippingCosts;
  135.     }
  136.     public function setShippingCosts(int $shippingCosts): void
  137.     {
  138.         $this->shippingCosts $shippingCosts;
  139.     }
  140.     public function getEcoTax(): int
  141.     {
  142.         return $this->ecoTax;
  143.     }
  144.     public function setEcoTax(int $ecoTax): void
  145.     {
  146.         $this->ecoTax $ecoTax;
  147.     }
  148.     public function getVatRate(): float
  149.     {
  150.         return $this->vatRate;
  151.     }
  152.     public function setVatRate(float $vatRate): void
  153.     {
  154.         $this->vatRate $vatRate;
  155.     }
  156.     public function getStock(): int
  157.     {
  158.         return $this->stock;
  159.     }
  160.     public function setStock(int $stock): void
  161.     {
  162.         $this->stock $stock;
  163.     }
  164.     public function isNew(): bool
  165.     {
  166.         return $this->new;
  167.     }
  168.     public function setNew(bool $new): void
  169.     {
  170.         $this->new $new;
  171.     }
  172.     public function getCreationDate(): ?DateTime
  173.     {
  174.         return $this->creationDate;
  175.     }
  176.     public function setCreationDate(?DateTime $creationDate): void
  177.     {
  178.         $this->creationDate $creationDate;
  179.     }
  180.     public function getShippingMode(): ?string
  181.     {
  182.         return $this->shippingMode;
  183.     }
  184.     public function setShippingMode(?string $shippingMode): void
  185.     {
  186.         $this->shippingMode $shippingMode;
  187.     }
  188.     public function getReferenceComm(): ?string
  189.     {
  190.         return $this->referenceComm;
  191.     }
  192.     public function setReferenceComm(?string $referenceComm): void
  193.     {
  194.         $this->referenceComm $referenceComm;
  195.     }
  196. }