You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TimestampableTrait.php 886B

пре 3 година
пре 3 година
12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace Lc\SovBundle\Doctrine\Extension;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. trait TimestampableTrait
  6. {
  7. /**
  8. * @ORM\Column(type="datetime")
  9. * @Gedmo\Timestampable(on="create")
  10. */
  11. protected $createdAt;
  12. /**
  13. * @ORM\Column(type="datetime")
  14. * @Gedmo\Timestampable(on="update")
  15. */
  16. protected $updatedAt;
  17. public function getCreatedAt(): ?\DateTimeInterface
  18. {
  19. return $this->createdAt;
  20. }
  21. public function setCreatedAt(\DateTimeInterface $createdAt): self
  22. {
  23. $this->createdAt = $createdAt;
  24. return $this;
  25. }
  26. public function getUpdatedAt(): ?\DateTimeInterface
  27. {
  28. return $this->updatedAt;
  29. }
  30. public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  31. {
  32. $this->updatedAt = $updatedAt;
  33. return $this;
  34. }
  35. }