Comment.php 1.5 KB

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