Comment.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 Comment implements Timestampable
  10. {
  11. /** @ORM\Id @ORM\GeneratedValue @ORM\Column(type="integer") */
  12. private $id;
  13. /**
  14. * @ORM\Column(name="message", type="text")
  15. */
  16. private $message;
  17. /**
  18. * @ORM\ManyToOne(targetEntity="Timestampable\Fixture\Article", inversedBy="comments")
  19. */
  20. private $article;
  21. /**
  22. * @ORM\Column(type="integer")
  23. */
  24. private $status;
  25. /**
  26. * @var datetime $closed
  27. *
  28. * @ORM\Column(name="closed", type="datetime", nullable=true)
  29. * @Gedmo\Timestampable(on="change", field="status", value=1)
  30. */
  31. private $closed;
  32. /**
  33. * @var datetime $modified
  34. *
  35. * @ORM\Column(name="modified", type="time")
  36. * @Gedmo\Timestampable(on="update")
  37. */
  38. private $modified;
  39. public function setArticle($article)
  40. {
  41. $this->article = $article;
  42. }
  43. public function getId()
  44. {
  45. return $this->id;
  46. }
  47. public function setStatus($status)
  48. {
  49. $this->status = $status;
  50. }
  51. public function getStatus()
  52. {
  53. return $this->status;
  54. }
  55. public function setMessage($message)
  56. {
  57. $this->message = $message;
  58. }
  59. public function getMessage()
  60. {
  61. return $this->message;
  62. }
  63. public function getModified()
  64. {
  65. return $this->modified;
  66. }
  67. public function getClosed()
  68. {
  69. return $this->closed;
  70. }
  71. }