src/Entity/LoadInvoiceProduct.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\LoadInvoiceProductRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. use Symfony\Component\Serializer\Annotation\MaxDepth;
  11. #[ORM\Entity(repositoryClassLoadInvoiceProductRepository::class)]
  12. #[ApiResource(
  13.     normalizationContext: ['groups' => ['load_invoice:read']],
  14.     denormalizationContext: ['groups' => ['load_invoice:write']],
  15.     order: ['id' => 'DESC'],
  16. )]
  17. class LoadInvoiceProduct
  18. {
  19.     #[Groups(['load_invoice:read''load_invoice:write''order:read''pre_order:read'])]
  20.     #[ORM\Id]
  21.     #[ORM\GeneratedValue]
  22.     #[ORM\Column]
  23.     private ?int $id null;
  24.     #[Groups(['load_invoice:read''load_invoice:write''order:read''pre_order:read'])]
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $name null;
  27.     #[Groups(['load_invoice:read''load_invoice:write''order:read''pre_order:read'])]
  28.     #[ORM\Column(length100nullabletrue)]
  29.     private ?string $article null;
  30.     #[MaxDepth(2)]
  31.     #[Groups(['load_invoice:read''load_invoice:write''order:read''pre_order:read'])]
  32.     #[ORM\ManyToOne]
  33.     private ?Products $product null;
  34.     #[MaxDepth(1)]
  35.     #[Groups(['load_invoice:read''load_invoice:write''order:read''pre_order:read'])]
  36.     #[ORM\ManyToOne]
  37.     private ?MeasurmentUnit $uaserment_unit null;
  38.     #[Groups(['load_invoice:read''load_invoice:write''order:read''pre_order:read'])]
  39.     #[ORM\Column(nullabletrue)]
  40.     private ?int $packaging null;
  41.     #[Groups(['load_invoice:read''load_invoice:write''order:read''pre_order:read'])]
  42.     #[ORM\Column(nullabletrue)]
  43.     private ?float $count null;
  44.     #[Groups(['load_invoice:read''load_invoice:write''order:read''pre_order:read'])]
  45.     #[ORM\Column(nullabletrue)]
  46.     private ?float $weight null;
  47.     #[Groups(['load_invoice:read''load_invoice:write''order:read''pre_order:read'])]
  48.     #[ORM\Column(nullabletrue)]
  49.     private ?float $fact_quantity null;
  50.     #[MaxDepth(1)]
  51.     #[Groups(['load_invoice:read''load_invoice:write''order:read''pre_order:read'])]
  52.     #[ORM\ManyToOne]
  53.     private ?Storage $storage null;
  54.     #[Groups(['load_invoice:read''load_invoice:write''order:read''pre_order:read'])]
  55.     #[ORM\Column(length100nullabletrue)]
  56.     private ?string $status null;
  57.     #[Groups(['load_invoice:read''load_invoice:write''order:read''pre_order:read'])]
  58.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  59.     private ?\DateTimeInterface $date_entered null;
  60.     #[Groups(['load_invoice:read''load_invoice:write'])]
  61.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  62.     private ?\DateTimeInterface $date_modified null;
  63.     #[MaxDepth(1)]
  64.     #[Groups(['load_invoice:read''load_invoice:write''order:read''pre_order:read'])]
  65.     #[ORM\ManyToOne]
  66.     private ?User $measurement_unit null;
  67.     #[ORM\ManyToOne]
  68.     private ?User $modified_user null;
  69.     #[ORM\ManyToOne]
  70.     private ?User $created_by null;
  71.     
  72.     #[MaxDepth(3)]
  73.     #[Groups(['load_invoice:read''load_invoice:write'])]
  74.     #[ORM\ManyToOne(inversedBy'loadInvoiceProducts')]
  75.     private ?OrderProduct $order_product null;
  76.     #[MaxDepth(3)]
  77.     #[Groups(['load_invoice:read''load_invoice:write'])]
  78.     #[ORM\ManyToOne(inversedBy'loadInvoiceProducts')]
  79.     private ?PreOrder $pre_order_product null;
  80.     #[Groups(['load_invoice:read''load_invoice:write'])]
  81.     #[ORM\OneToMany(mappedBy'load_invoice_product'targetEntityAcceptedProduct::class)]
  82.     private Collection $acceptedProducts;
  83.     #[ORM\ManyToOne(inversedBy'loadInvoiceProducts'cascade:['persist'])]
  84.     private ?LoadInvoice $loadInvoice null;
  85.     #[ORM\Column(nullabletrue)]
  86.     private ?bool $pdv null;
  87.     public function __construct()
  88.     {
  89.         $this->acceptedProducts = new ArrayCollection();
  90.     }
  91.     public function getId(): ?int
  92.     {
  93.         return $this->id;
  94.     }
  95.     public function getName(): ?string
  96.     {
  97.         return $this->name;
  98.     }
  99.     public function setName(?string $name): self
  100.     {
  101.         $this->name $name;
  102.         return $this;
  103.     }
  104.     public function getArticle(): ?string
  105.     {
  106.         return $this->article;
  107.     }
  108.     public function setArticle(?string $article): self
  109.     {
  110.         $this->article $article;
  111.         return $this;
  112.     }
  113.     public function getProduct(): ?Products
  114.     {
  115.         return $this->product;
  116.     }
  117.     public function setProduct(?Products $product): self
  118.     {
  119.         $this->product $product;
  120.         return $this;
  121.     }
  122.     public function getUasermentUnit(): ?MeasurmentUnit
  123.     {
  124.         return $this->uaserment_unit;
  125.     }
  126.     public function setUasermentUnit(?MeasurmentUnit $uaserment_unit): self
  127.     {
  128.         $this->uaserment_unit $uaserment_unit;
  129.         return $this;
  130.     }
  131.     public function getPackaging(): ?int
  132.     {
  133.         return $this->packaging;
  134.     }
  135.     public function setPackaging(?int $packaging): self
  136.     {
  137.         $this->packaging $packaging;
  138.         return $this;
  139.     }
  140.     public function getCount(): ?float
  141.     {
  142.         return $this->count;
  143.     }
  144.     public function setCount(?float $count): self
  145.     {
  146.         $this->count $count;
  147.         return $this;
  148.     }
  149.     public function getWeight(): ?float
  150.     {
  151.         return $this->weight;
  152.     }
  153.     public function setWeight(?float $weight): self
  154.     {
  155.         $this->weight $weight;
  156.         return $this;
  157.     }
  158.     public function getFactQuantity(): ?float
  159.     {
  160.         return $this->fact_quantity;
  161.     }
  162.     public function setFactQuantity(?float $fact_quantity): self
  163.     {
  164.         $this->fact_quantity $fact_quantity;
  165.         return $this;
  166.     }
  167.     public function getStorage(): ?Storage
  168.     {
  169.         return $this->storage;
  170.     }
  171.     public function setStorage(?Storage $storage): self
  172.     {
  173.         $this->storage $storage;
  174.         return $this;
  175.     }
  176.     public function getStatus(): ?string
  177.     {
  178.         return $this->status;
  179.     }
  180.     public function setStatus(?string $status): self
  181.     {
  182.         $this->status $status;
  183.         return $this;
  184.     }
  185.     public function getDateEntered(): ?\DateTimeInterface
  186.     {
  187.         return $this->date_entered;
  188.     }
  189.     public function setDateEntered(?\DateTimeInterface $date_entered): self
  190.     {
  191.         $this->date_entered $date_entered;
  192.         return $this;
  193.     }
  194.     public function getDateModified(): ?\DateTimeInterface
  195.     {
  196.         return $this->date_modified;
  197.     }
  198.     public function setDateModified(?\DateTimeInterface $date_modified): self
  199.     {
  200.         $this->date_modified $date_modified;
  201.         return $this;
  202.     }
  203.     public function getMeasurementUnit(): ?User
  204.     {
  205.         return $this->measurement_unit;
  206.     }
  207.     public function setMeasurementUnit(?User $measurement_unit): self
  208.     {
  209.         $this->measurement_unit $measurement_unit;
  210.         return $this;
  211.     }
  212.     public function getModifiedUser(): ?User
  213.     {
  214.         return $this->modified_user;
  215.     }
  216.     public function setModifiedUser(?User $modified_user): self
  217.     {
  218.         $this->modified_user $modified_user;
  219.         return $this;
  220.     }
  221.     public function getCreatedBy(): ?User
  222.     {
  223.         return $this->created_by;
  224.     }
  225.     public function setCreatedBy(?User $created_by): self
  226.     {
  227.         $this->created_by $created_by;
  228.         return $this;
  229.     }
  230.     public function getOrderProduct(): ?OrderProduct
  231.     {
  232.         return $this->order_product;
  233.     }
  234.     public function setOrderProduct(?OrderProduct $order_product): self
  235.     {
  236.         $this->order_product $order_product;
  237.         return $this;
  238.     }
  239.     public function getPreOrderProduct(): ?PreOrder
  240.     {
  241.         return $this->pre_order_product;
  242.     }
  243.     public function setPreOrderProduct(?PreOrder $pre_order_product): self
  244.     {
  245.         $this->pre_order_product $pre_order_product;
  246.         return $this;
  247.     }
  248.     /**
  249.      * @return Collection<int, AcceptedProduct>
  250.      */
  251.     public function getAcceptedProducts(): Collection
  252.     {
  253.         return $this->acceptedProducts;
  254.     }
  255.     public function addAcceptedProduct(AcceptedProduct $acceptedProduct): self
  256.     {
  257.         if (!$this->acceptedProducts->contains($acceptedProduct)) {
  258.             $this->acceptedProducts->add($acceptedProduct);
  259.             $acceptedProduct->setLoadInvoiceProduct($this);
  260.         }
  261.         return $this;
  262.     }
  263.     public function removeAcceptedProduct(AcceptedProduct $acceptedProduct): self
  264.     {
  265.         if ($this->acceptedProducts->removeElement($acceptedProduct)) {
  266.             // set the owning side to null (unless already changed)
  267.             if ($acceptedProduct->getLoadInvoiceProduct() === $this) {
  268.                 $acceptedProduct->setLoadInvoiceProduct(null);
  269.             }
  270.         }
  271.         return $this;
  272.     }
  273.     public function getLoadInvoice(): ?LoadInvoice
  274.     {
  275.         return $this->loadInvoice;
  276.     }
  277.     public function setLoadInvoice(?LoadInvoice $loadInvoice): self
  278.     {
  279.         $this->loadInvoice $loadInvoice;
  280.         return $this;
  281.     }
  282.     public function isPdv(): ?bool
  283.     {
  284.         return $this->pdv;
  285.     }
  286.     public function setPdv(?bool $pdv): self
  287.     {
  288.         $this->pdv $pdv;
  289.         return $this;
  290.     }
  291. }