<?php
namespace App\Entity\Request;
use App\Entity\User\User;
use App\Repository\Request\RequestHistoryRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity(repositoryClass: RequestHistoryRepository::class)]
class RequestHistory
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'requestHistories')]
#[ORM\JoinColumn(nullable: false)]
private ?RequestForm $requestForm = null;
#[ORM\ManyToOne(inversedBy: 'requestHistories')]
#[ORM\JoinColumn(nullable: false)]
private ?RequestStatus $requestStatus = null;
#[ORM\ManyToOne(inversedBy: 'requestHistories')]
private ?User $user = null;
/**
* @Gedmo\Timestampable(on="create")
*/
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $dateCreated = null;
public function __construct()
{
$this->dateCreated = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getRequestForm(): ?RequestForm
{
return $this->requestForm;
}
public function setRequestForm(?RequestForm $requestForm): self
{
$this->requestForm = $requestForm;
return $this;
}
public function getRequestStatus(): ?RequestStatus
{
return $this->requestStatus;
}
public function setRequestStatus(?RequestStatus $requestStatus): self
{
$this->requestStatus = $requestStatus;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getDateCreated(): ?\DateTimeInterface
{
return $this->dateCreated;
}
public function setDateCreated(?\DateTimeInterface $dateCreated): self
{
$this->dateCreated = $dateCreated;
return $this;
}
}