SoftDeleteableEntity.php 906B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. * @package Gedmo.SoftDeleteable.Traits
  8. * @subpackage SoftDeleteableEntity
  9. * @link http://www.gediminasm.org
  10. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  11. */
  12. trait SoftDeleteableEntity
  13. {
  14. /**
  15. * @Gedmo\SoftDeleteable(on="delete")
  16. * @ORM\Column(type="datetime")
  17. */
  18. protected $deletedAt;
  19. /**
  20. * Sets deletedAt.
  21. *
  22. * @param \Datetime|null $deletedAt
  23. * @return $this
  24. */
  25. public function setDeletedAt(\DateTime $deletedAt = null)
  26. {
  27. $this->deletedAt = $deletedAt;
  28. return $this;
  29. }
  30. /**
  31. * Returns deletedAt.
  32. *
  33. * @return DateTime
  34. */
  35. public function getDeletedAt()
  36. {
  37. return $this->deletedAt;
  38. }
  39. }