import hiltes
This commit is contained in:
@@ -10,92 +10,66 @@ class Stock
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $gtin;
|
||||
#[ORM\Column]
|
||||
private ?int $instock = null;
|
||||
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $stock;
|
||||
|
||||
#[ORM\Column(type: 'datetime', nullable: true)]
|
||||
private $update_time;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Warehouse::class, inversedBy: 'warehouse_id')]
|
||||
private $warehouse_id;
|
||||
#[ORM\OneToOne(mappedBy: 'stock', cascade: ['persist', 'remove'])]
|
||||
private ?Product $product = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'stocks')]
|
||||
private ?Products $prod_id = null;
|
||||
private ?Warehouse $warehouse = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getGtin(): ?string
|
||||
public function getInstock(): ?int
|
||||
{
|
||||
return $this->gtin;
|
||||
return $this->instock;
|
||||
}
|
||||
|
||||
public function setGtin(string $gtin): self
|
||||
public function setInstock(int $instock): self
|
||||
{
|
||||
$this->gtin = $gtin;
|
||||
$this->instock = $instock;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStock(): ?int
|
||||
public function getProduct(): ?Product
|
||||
{
|
||||
return $this->stock;
|
||||
return $this->product;
|
||||
}
|
||||
|
||||
public function setStock(int $stock): self
|
||||
public function setProduct(?Product $product): self
|
||||
{
|
||||
$this->stock = $stock;
|
||||
// unset the owning side of the relation if necessary
|
||||
if ($product === null && $this->product !== null) {
|
||||
$this->product->setStock(null);
|
||||
}
|
||||
|
||||
// set the owning side of the relation if necessary
|
||||
if ($product !== null && $product->getStock() !== $this) {
|
||||
$product->setStock($this);
|
||||
}
|
||||
|
||||
$this->product = $product;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUpdateTime(): ?\DateTimeInterface
|
||||
public function getWarehouse(): ?Warehouse
|
||||
{
|
||||
return $this->update_time;
|
||||
return $this->warehouse;
|
||||
}
|
||||
|
||||
public function setUpdateTime(?\DateTimeInterface $update_time): self
|
||||
public function setWarehouse(?Warehouse $warehouse): self
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
$this->warehouse = $warehouse;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWarehouseId(): ?int
|
||||
{
|
||||
return $this->warehouse_id;
|
||||
}
|
||||
|
||||
public function setWarehouseId(int $warehouse_id): self
|
||||
{
|
||||
$this->warehouse_id = $warehouse_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getProdId(): ?Products
|
||||
{
|
||||
return $this->prod_id;
|
||||
}
|
||||
|
||||
public function setProdId(?Products $prod_id): self
|
||||
{
|
||||
$this->prod_id = $prod_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setWarehouse(Warehouse $warehouse): self
|
||||
{
|
||||
$this->warehouse_id = $warehouse->getId();
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user