src/Entity/ArticleHistory.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ArticleHistoryRepository;
  4. use DateTimeImmutable;
  5. use DateTimeInterface;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ArticleHistoryRepository::class)
  9.  * @ORM\Table(name="app_article_history")
  10.  */
  11. class ArticleHistory
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity=Article::class, inversedBy="articleHistory")
  21.      * @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
  22.      */
  23.     private ?Article $article;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="articleHistory")
  26.      * @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
  27.      */
  28.     private ?User $user;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private ?string $messageId;
  33.     /**
  34.      * @ORM\Column(type="datetime_immutable", nullable=true, options={"default": "CURRENT_TIMESTAMP"})
  35.      */
  36.     private ?DateTimeInterface $createAt;
  37.     public function __construct()
  38.     {
  39.         $this->createAt = new DateTimeImmutable();
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getUser(): ?User
  46.     {
  47.         return $this->user;
  48.     }
  49.     public function setUser(?User $user): self
  50.     {
  51.         $this->user $user;
  52.         return $this;
  53.     }
  54.     public function getArticle(): ?Article
  55.     {
  56.         return $this->article;
  57.     }
  58.     public function setArticle(?Article $article): self
  59.     {
  60.         $this->article $article;
  61.         return $this;
  62.     }
  63.     public function getMessageId(): ?string
  64.     {
  65.         return $this->messageId;
  66.     }
  67.     public function setMessageId(?string $messageId): self
  68.     {
  69.         $this->messageId $messageId;
  70.         return $this;
  71.     }
  72.     public function getCreateAt(): ?DateTimeInterface
  73.     {
  74.         return $this->createAt;
  75.     }
  76.     public function setCreateAt(?DateTimeImmutable $createAt): self
  77.     {
  78.         $this->createAt $createAt;
  79.         return $this;
  80.     }
  81. }