Add Stock & Warehouse
This commit is contained in:
80
src/Entity/Stock.php
Normal file
80
src/Entity/Stock.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\StockRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: StockRepository::class)]
|
||||
class Stock
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $product_id;
|
||||
|
||||
#[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;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getProductId(): ?string
|
||||
{
|
||||
return $this->product_id;
|
||||
}
|
||||
|
||||
public function setProductId(string $product_id): self
|
||||
{
|
||||
$this->product_id = $product_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStock(): ?int
|
||||
{
|
||||
return $this->stock;
|
||||
}
|
||||
|
||||
public function setStock(int $stock): self
|
||||
{
|
||||
$this->stock = $stock;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUpdateTime(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
public function setUpdateTime(?\DateTimeInterface $update_time): self
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWarehouseId(): ?Warehouse
|
||||
{
|
||||
return $this->warehouse_id;
|
||||
}
|
||||
|
||||
public function setWarehouseId(?Warehouse $warehouse_id): self
|
||||
{
|
||||
$this->warehouse_id = $warehouse_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user