src/Entity/System/OrderDetailQuantityStock.php line 26

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\System;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Table(
  7. * name="order_detail_quantity_stock",
  8. * uniqueConstraints={
  9. *
  10. * @ORM\UniqueConstraint(name="uk_order_detail_product_stock", columns={"order_detail_id", "product_stock_id"})
  11. * },
  12. * indexes={
  13. *
  14. * @ORM\Index(name="idx_order_detail_quantity_stock_order_detail", columns={"order_detail_id"}),
  15. * @ORM\Index(name="idx_order_detail_quantity_stock_product_stock", columns={"product_stock_id"}),
  16. * @ORM\Index(name="idx_odqs_order_detail_purchase_ref", columns={"order_detail_id", "purchase_order_reference"})
  17. * }
  18. * )
  19. *
  20. * @ORM\Entity(repositoryClass="App\Repository\System\OrderDetailQuantityStockRepository")
  21. */
  22. class OrderDetailQuantityStock
  23. {
  24. /**
  25. * @ORM\Id
  26. *
  27. * @ORM\GeneratedValue(strategy="AUTO")
  28. *
  29. * @ORM\Column(type="integer")
  30. */
  31. private int $id;
  32. /**
  33. * @ORM\ManyToOne(targetEntity="App\Entity\System\OrderDetail", inversedBy="orderDetailQuantityStocks", cascade={"persist"})
  34. *
  35. * @ORM\JoinColumn(name="order_detail_id", referencedColumnName="id_order_detail", nullable=false)
  36. */
  37. private OrderDetail $orderDetail;
  38. /**
  39. * @ORM\ManyToOne(targetEntity="App\Entity\System\ProductStock")
  40. *
  41. * @ORM\JoinColumn(name="product_stock_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
  42. */
  43. private ?ProductStock $productStock = null;
  44. /**
  45. * @ORM\Column(type="integer", nullable=false, options={"default": 0})
  46. */
  47. private int $quantity = 0;
  48. /**
  49. * @ORM\Column(type="string", name="purchase_order_reference", nullable=true)
  50. */
  51. private ?string $purchaseOrderReference = null;
  52. /**
  53. * @ORM\Column(type="boolean", name="stock_returned", nullable=false, options={"default": 0})
  54. */
  55. private bool $stockReturned = false;
  56. public function getId(): int
  57. {
  58. return $this->id;
  59. }
  60. public function getOrderDetail(): OrderDetail
  61. {
  62. return $this->orderDetail;
  63. }
  64. public function setOrderDetail(OrderDetail $orderDetail): self
  65. {
  66. $this->orderDetail = $orderDetail;
  67. return $this;
  68. }
  69. public function getProductStock(): ?ProductStock
  70. {
  71. return $this->productStock;
  72. }
  73. public function setProductStock(?ProductStock $productStock): self
  74. {
  75. $this->productStock = $productStock;
  76. return $this;
  77. }
  78. public function getQuantity(): int
  79. {
  80. return $this->quantity;
  81. }
  82. public function setQuantity(int $quantity): self
  83. {
  84. $this->quantity = $quantity;
  85. return $this;
  86. }
  87. public function getPurchaseOrderReference(): ?string
  88. {
  89. return $this->purchaseOrderReference;
  90. }
  91. public function setPurchaseOrderReference(?string $purchaseOrderReference): self
  92. {
  93. $this->purchaseOrderReference = $purchaseOrderReference;
  94. return $this;
  95. }
  96. public function isStockReturned(): bool
  97. {
  98. return $this->stockReturned;
  99. }
  100. public function setStockReturned(bool $stockReturned): self
  101. {
  102. $this->stockReturned = $stockReturned;
  103. return $this;
  104. }
  105. }