SoftDeleteableEntity.php 768 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Gedmo\SoftDeleteable\Traits;
  3. /**
  4. * SoftDeletable Trait, usable with PHP >= 5.4
  5. *
  6. * @author Wesley van Opdorp <wesley.van.opdorp@freshheads.com>
  7. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  8. */
  9. trait SoftDeleteableEntity
  10. {
  11. /**
  12. * @ORM\Column(type="datetime", nullable=true)
  13. */
  14. protected $deletedAt;
  15. /**
  16. * Sets deletedAt.
  17. *
  18. * @param \Datetime|null $deletedAt
  19. * @return $this
  20. */
  21. public function setDeletedAt(\DateTime $deletedAt = null)
  22. {
  23. $this->deletedAt = $deletedAt;
  24. return $this;
  25. }
  26. /**
  27. * Returns deletedAt.
  28. *
  29. * @return DateTime
  30. */
  31. public function getDeletedAt()
  32. {
  33. return $this->deletedAt;
  34. }
  35. }