<?php
declare(strict_types=1);
namespace App\Entity\System;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(
* name="order_detail_quantity_stock",
* uniqueConstraints={
*
* @ORM\UniqueConstraint(name="uk_order_detail_product_stock", columns={"order_detail_id", "product_stock_id"})
* },
* indexes={
*
* @ORM\Index(name="idx_order_detail_quantity_stock_order_detail", columns={"order_detail_id"}),
* @ORM\Index(name="idx_order_detail_quantity_stock_product_stock", columns={"product_stock_id"}),
* @ORM\Index(name="idx_odqs_order_detail_purchase_ref", columns={"order_detail_id", "purchase_order_reference"})
* }
* )
*
* @ORM\Entity(repositoryClass="App\Repository\System\OrderDetailQuantityStockRepository")
*/
class OrderDetailQuantityStock
{
/**
* @ORM\Id
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @ORM\Column(type="integer")
*/
private int $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\System\OrderDetail", inversedBy="orderDetailQuantityStocks", cascade={"persist"})
*
* @ORM\JoinColumn(name="order_detail_id", referencedColumnName="id_order_detail", nullable=false)
*/
private OrderDetail $orderDetail;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\System\ProductStock")
*
* @ORM\JoinColumn(name="product_stock_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
*/
private ?ProductStock $productStock = null;
/**
* @ORM\Column(type="integer", nullable=false, options={"default": 0})
*/
private int $quantity = 0;
/**
* @ORM\Column(type="string", name="purchase_order_reference", nullable=true)
*/
private ?string $purchaseOrderReference = null;
/**
* @ORM\Column(type="boolean", name="stock_returned", nullable=false, options={"default": 0})
*/
private bool $stockReturned = false;
public function getId(): int
{
return $this->id;
}
public function getOrderDetail(): OrderDetail
{
return $this->orderDetail;
}
public function setOrderDetail(OrderDetail $orderDetail): self
{
$this->orderDetail = $orderDetail;
return $this;
}
public function getProductStock(): ?ProductStock
{
return $this->productStock;
}
public function setProductStock(?ProductStock $productStock): self
{
$this->productStock = $productStock;
return $this;
}
public function getQuantity(): int
{
return $this->quantity;
}
public function setQuantity(int $quantity): self
{
$this->quantity = $quantity;
return $this;
}
public function getPurchaseOrderReference(): ?string
{
return $this->purchaseOrderReference;
}
public function setPurchaseOrderReference(?string $purchaseOrderReference): self
{
$this->purchaseOrderReference = $purchaseOrderReference;
return $this;
}
public function isStockReturned(): bool
{
return $this->stockReturned;
}
public function setStockReturned(bool $stockReturned): self
{
$this->stockReturned = $stockReturned;
return $this;
}
}