This commit is contained in:
@@ -3,16 +3,17 @@
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\StockRepository;
|
||||
#use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
#[ORM\Entity(repositoryClass: StockRepository::class)]
|
||||
#[ORM\UniqueEntity(['warehouse_id', 'product_id'])]
|
||||
#[ORM\UniqueConstraint(
|
||||
name: 'UNIQ_D34A04ADDCD6110',
|
||||
columns: ['warehouse_id', 'product_id']
|
||||
name: 'UNIQ_D34A04ADDCD6110',
|
||||
columns: ['warehouse_id', 'product_id']
|
||||
)]
|
||||
class Stock
|
||||
{
|
||||
@@ -29,19 +30,19 @@ class Stock
|
||||
#[ORM\ManyToOne(inversedBy: 'stocks')]
|
||||
private ?Warehouse $warehouse = null;
|
||||
|
||||
#[ORM\Column(name: 'update_time',type: Types::DATETIME_MUTABLE, nullable: true, options: ['default' => 'CURRENT_TIMESTAMP'])]
|
||||
private ?\DateTimeInterface $update_time = null;
|
||||
|
||||
#[ORM\Column(name: 'update_time', type: Types::DATETIME_MUTABLE, nullable: true, options: ['default' => 'CURRENT_TIMESTAMP'])]
|
||||
private ?DateTimeInterface $update_time = null;
|
||||
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(int $id): ?self
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getInstock(): ?int
|
||||
@@ -55,6 +56,7 @@ class Stock
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getProductId(): ?int
|
||||
{
|
||||
return $this->product_id;
|
||||
@@ -66,6 +68,7 @@ class Stock
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWarehouseId(): ?int
|
||||
{
|
||||
return $this->warehouse_id;
|
||||
@@ -112,12 +115,12 @@ class Stock
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUpdateTime(): ?\DateTimeInterface
|
||||
public function getUpdateTime(): ?DateTimeInterface
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
public function setUpdateTime(?\DateTimeInterface $update_time): self
|
||||
public function setUpdateTime(?DateTimeInterface $update_time): self
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user