TitledArticle.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?php
  2. namespace Timestampable\Fixture;
  3. use Gedmo\Timestampable\Timestampable;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity
  8. */
  9. class TitledArticle implements Timestampable
  10. {
  11. /**
  12. * @ORM\Id
  13. * @ORM\GeneratedValue
  14. * @ORM\Column(type="integer")
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column(name="title", type="string", length=128)
  19. */
  20. private $title;
  21. /**
  22. * @ORM\Column(name="text", type="string", length=128)
  23. */
  24. private $text;
  25. /**
  26. * @ORM\Column(name="state", type="string", length=128)
  27. */
  28. private $state;
  29. /**
  30. * @var \DateTime $updated
  31. *
  32. * @ORM\Column(name="chtext", type="datetime", nullable=true)
  33. * @Gedmo\Timestampable(on="change", field="text")
  34. */
  35. private $chtext;
  36. /**
  37. * @var \DateTime $chtitle
  38. *
  39. * @ORM\Column(name="chtitle", type="datetime", nullable=true)
  40. * @Gedmo\Timestampable(on="change", field="title")
  41. */
  42. private $chtitle;
  43. /**
  44. * @var \DateTime $closed
  45. *
  46. * @ORM\Column(name="closed", type="datetime", nullable=true)
  47. * @Gedmo\Timestampable(on="change", field="state", value={"Published", "Closed"})
  48. */
  49. private $closed;
  50. /**
  51. * @param \DateTime $chtext
  52. */
  53. public function setChtext($chtext)
  54. {
  55. $this->chtext = $chtext;
  56. }
  57. /**
  58. * @return \DateTime
  59. */
  60. public function getChtext()
  61. {
  62. return $this->chtext;
  63. }
  64. /**
  65. * @param \DateTime $chtitle
  66. */
  67. public function setChtitle($chtitle)
  68. {
  69. $this->chtitle = $chtitle;
  70. }
  71. /**
  72. * @return \DateTime
  73. */
  74. public function getChtitle()
  75. {
  76. return $this->chtitle;
  77. }
  78. /**
  79. * @param \DateTime $closed
  80. */
  81. public function setClosed($closed)
  82. {
  83. $this->closed = $closed;
  84. }
  85. /**
  86. * @return \DateTime
  87. */
  88. public function getClosed()
  89. {
  90. return $this->closed;
  91. }
  92. public function setId($id)
  93. {
  94. $this->id = $id;
  95. }
  96. public function getId()
  97. {
  98. return $this->id;
  99. }
  100. public function setText($text)
  101. {
  102. $this->text = $text;
  103. }
  104. public function getText()
  105. {
  106. return $this->text;
  107. }
  108. public function setTitle($title)
  109. {
  110. $this->title = $title;
  111. }
  112. public function getTitle()
  113. {
  114. return $this->title;
  115. }
  116. public function setState($state)
  117. {
  118. $this->state = $state;
  119. }
  120. public function getState()
  121. {
  122. return $this->state;
  123. }
  124. }