<?php
/**
* @author Quentin CHATELAIN (contact@scaledev.fr)
* @copyright 2021 - ScaleDEV SAS, 12 RUE CHARLES MORET, 10120 ST ANDRE LES VERGERS
* @license commercial
*/
declare(strict_types=1);
namespace Bluue\SalesBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
use Bluue\SalesBundle\Repository\OrderHistoryRepository;
use App\DoctrineExtensions\Timestampable\Traits\UserTimestampableEntity;
/**
* @ORM\Entity(repositoryClass=OrderHistoryRepository::class)
* @ORM\Table(name="sales_bundle__order_history", indexes={
* @ORM\Index(name="created_at", columns={"created_at"}),
* @ORM\Index(name="updated_at", columns={"updated_at"})
* })
*/
class OrderHistory
{
use UserTimestampableEntity;
/**
* @ORM\Id
* @ORM\Column(type="uuid")
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class=UuidGenerator::class)
*/
private ?Uuid $id = null;
/**
* @ORM\ManyToOne(targetEntity=Order::class, inversedBy="histories")
*/
private ?Order $order = null;
/**
* @ORM\ManyToOne(targetEntity=OrderState::class)
*/
private ?OrderState $order_state = null;
/**
* @return Uuid|null
*/
public function getId(): ?Uuid
{
return $this->id;
}
/**
* @return Order|null
*/
public function getOrder(): ?Order
{
return $this->order;
}
/**
* @param Order|null $order
* @return OrderHistory
*/
public function setOrder(?Order $order): self
{
$this->order = $order;
return $this;
}
/**
* @return OrderState|null
*/
public function getOrderState(): ?OrderState
{
return $this->order_state;
}
/**
* @param OrderState|null $order_state
* @return OrderHistory
*/
public function setOrderState(?OrderState $order_state): self
{
$this->order_state = $order_state;
return $this;
}
}