import hiltes
This commit is contained in:
83
src/Entity/Product.php
Normal file
83
src/Entity/Product.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use App\Repository\ProductRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: ProductRepository::class)]
|
||||
#[ApiResource]
|
||||
class Product
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $gtin = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $shopwareId = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
|
||||
private ?\DateTimeInterface $updateTime = null;
|
||||
|
||||
#[ORM\OneToOne(inversedBy: 'product', cascade: ['persist', 'remove'])]
|
||||
private ?Stock $stock = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getGtin(): ?string
|
||||
{
|
||||
return $this->gtin;
|
||||
}
|
||||
|
||||
public function setGtin(string $gtin): self
|
||||
{
|
||||
$this->gtin = $gtin;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getShopwareId(): ?string
|
||||
{
|
||||
return $this->shopwareId;
|
||||
}
|
||||
|
||||
public function setShopwareId(string $shopwareId): self
|
||||
{
|
||||
$this->shopwareId = $shopwareId;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUpdateTime(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->updateTime;
|
||||
}
|
||||
|
||||
public function setUpdateTime(\DateTimeInterface $updateTime): self
|
||||
{
|
||||
$this->updateTime = $updateTime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStock(): ?Stock
|
||||
{
|
||||
return $this->stock;
|
||||
}
|
||||
|
||||
public function setStock(?Stock $stock): self
|
||||
{
|
||||
$this->stock = $stock;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user