src/Entity/AbstractTimestamp.php line 17

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8. * @ORM\MappedSuperclass
  9. * The most generic type of item.
  10. *
  11. * @see http://schema.org/Thing Documentation on Schema.org
  12. */
  13. abstract class AbstractTimestamp
  14. {
  15. /**
  16. * @ORM\Column(type="datetime", nullable=true)
  17. * @Groups({"output"})
  18. *
  19. * @var \DateTimeInterface|null
  20. *
  21. */
  22. protected $createdAt;
  23. /**
  24. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  25. *
  26. * @var User|null
  27. */
  28. protected $createdBy;
  29. /**
  30. * @ORM\Column(type="datetime", nullable=true)
  31. * @Groups({"output"})
  32. *
  33. * @var \DateTimeInterface|null
  34. *
  35. */
  36. protected $updatedAt;
  37. /**
  38. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  39. *
  40. * @var User|null
  41. */
  42. protected $updatedBy;
  43. public function setCreatedAt(?\DateTimeInterface $createdAt): self
  44. {
  45. $this->createdAt = $createdAt;
  46. return $this;
  47. }
  48. public function getCreatedAt(): ?\DateTimeInterface
  49. {
  50. return $this->createdAt;
  51. }
  52. public function setCreatedBy(?User $createdBy): self
  53. {
  54. $this->createdBy = $createdBy;
  55. return $this;
  56. }
  57. public function getCreatedBy(): ?User
  58. {
  59. return $this->createdBy;
  60. }
  61. public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  62. {
  63. $this->updatedAt = $updatedAt;
  64. return $this;
  65. }
  66. public function getUpdatedAt(): ?\DateTimeInterface
  67. {
  68. return $this->updatedAt;
  69. }
  70. public function setUpdatedBy(?User $updatedBy): self
  71. {
  72. $this->updatedBy = $updatedBy;
  73. return $this;
  74. }
  75. public function getUpdatedBy(): ?User
  76. {
  77. return $this->updatedBy;
  78. }
  79. }