64 lines
1.2 KiB
PHP
64 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
use App\Repository\ProductRepository;
|
|
use DateTimeInterface;
|
|
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(name: 'update_time', type: Types::DATETIME_MUTABLE, nullable: true, options: ['default' => 'CURRENT_TIMESTAMP'])]
|
|
private ?DateTimeInterface $updateTime = 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 getUpdateTime(): ?DateTimeInterface
|
|
{
|
|
return $this->updateTime;
|
|
}
|
|
|
|
public function setUpdateTime(DateTimeInterface $updateTime): self
|
|
{
|
|
$this->updateTime = $updateTime;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function setStock(Stock $stock): self
|
|
{
|
|
|
|
$this->stock = $stock;
|
|
return $this;
|
|
}
|
|
|
|
}
|