This commit is contained in:
@@ -2,8 +2,10 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use ApiPlatform\Metadata\ApiProperty;
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use App\Repository\OrderRepository;
|
||||
use DateTimeInterface;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
@@ -14,6 +16,7 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
* 2 = Bestellung in Bearbeitung
|
||||
* 3 = Bestellung versendet
|
||||
*/
|
||||
|
||||
#[ORM\Entity(repositoryClass: OrderRepository::class)]
|
||||
#[ORM\Table(name: '`order`')]
|
||||
#[ApiResource]
|
||||
@@ -22,9 +25,12 @@ class Order
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
#[ApiProperty(identifier: false)]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255,unique: true)]
|
||||
#[ApiProperty(identifier: true)]
|
||||
|
||||
private ?string $orderId = null;
|
||||
|
||||
#[ORM\Column]
|
||||
@@ -33,8 +39,8 @@ class Order
|
||||
#[ORM\Column]
|
||||
private array $data = [];
|
||||
|
||||
#[ORM\Column(name: 'change_date',type: Types::DATETIME_MUTABLE, nullable: true, options: ['default' => 'CURRENT_TIMESTAMP'])]
|
||||
private ?\DateTimeInterface $changeDate = null;
|
||||
#[ORM\Column(name: 'change_date', type: Types::DATETIME_MUTABLE, nullable: true, options: ['default' => 'CURRENT_TIMESTAMP'])]
|
||||
private ?DateTimeInterface $changeDate = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
@@ -77,12 +83,12 @@ class Order
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getChangeDate(): ?\DateTimeInterface
|
||||
public function getChangeDate(): ?DateTimeInterface
|
||||
{
|
||||
return $this->changeDate;
|
||||
}
|
||||
|
||||
public function setChangeDate(\DateTimeInterface $changeDate): static
|
||||
public function setChangeDate(DateTimeInterface $changeDate): static
|
||||
{
|
||||
$this->changeDate = $changeDate;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user