BlameableEntity.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. namespace Gedmo\Blameable\Traits;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. /**
  6. * Blameable Trait, usable with PHP >= 5.4
  7. *
  8. * @author David Buchmann <mail@davidbu.ch>
  9. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  10. */
  11. trait BlameableEntity
  12. {
  13. /**
  14. * @var string
  15. * @Gedmo\Blameable(on="create")
  16. * @ORM\Column(nullable=true)
  17. */
  18. protected $createdBy;
  19. /**
  20. * @var string
  21. * @Gedmo\Blameable(on="update")
  22. * @ORM\Column(nullable=true)
  23. */
  24. protected $updatedBy;
  25. /**
  26. * Sets createdBy.
  27. *
  28. * @param string $createdBy
  29. * @return $this
  30. */
  31. public function setCreatedBy($createdBy)
  32. {
  33. $this->createdBy = $createdBy;
  34. return $this;
  35. }
  36. /**
  37. * Returns createdBy.
  38. *
  39. * @return string
  40. */
  41. public function getCreatedBy()
  42. {
  43. return $this->createdBy;
  44. }
  45. /**
  46. * Sets updatedBy.
  47. *
  48. * @param string $updatedBy
  49. * @return $this
  50. */
  51. public function setUpdatedBy($updatedBy)
  52. {
  53. $this->updatedBy = $updatedBy;
  54. return $this;
  55. }
  56. /**
  57. * Returns updatedBy.
  58. *
  59. * @return string
  60. */
  61. public function getUpdatedBy()
  62. {
  63. return $this->updatedBy;
  64. }
  65. }