Article.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?php
  2. namespace Blameable\Fixture\Document;
  3. use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. /**
  6. * @ODM\Document(collection="articles")
  7. */
  8. class Article
  9. {
  10. /** @ODM\Id */
  11. private $id;
  12. /**
  13. * @ODM\String
  14. */
  15. private $title;
  16. /**
  17. * @ODM\ReferenceOne(targetDocument="Type")
  18. */
  19. private $type;
  20. /**
  21. * @var string $created
  22. *
  23. * @ODM\String
  24. * @Gedmo\Blameable(on="create")
  25. */
  26. private $created;
  27. /**
  28. * @var string $updated
  29. *
  30. * @ODM\String
  31. * @Gedmo\Blameable
  32. */
  33. private $updated;
  34. /**
  35. * @ODM\ReferenceOne(targetDocument="User")
  36. * @Gedmo\Blameable(on="create")
  37. */
  38. private $creator;
  39. /**
  40. * @var string $published
  41. *
  42. * @ODM\String
  43. * @Gedmo\Blameable(on="change", field="type.title", value="Published")
  44. */
  45. private $published;
  46. public function getId()
  47. {
  48. return $this->id;
  49. }
  50. public function setTitle($title)
  51. {
  52. $this->title = $title;
  53. }
  54. public function getTitle()
  55. {
  56. return $this->title;
  57. }
  58. public function getCreated()
  59. {
  60. return $this->created;
  61. }
  62. public function getPublished()
  63. {
  64. return $this->published;
  65. }
  66. public function getCreator()
  67. {
  68. return $this->creator;
  69. }
  70. public function getUpdated()
  71. {
  72. return $this->updated;
  73. }
  74. public function setType(Type $type)
  75. {
  76. $this->type = $type;
  77. }
  78. public function getType()
  79. {
  80. return $this->type;
  81. }
  82. public function setCreated($created)
  83. {
  84. $this->created = $created;
  85. }
  86. public function setPublished($published)
  87. {
  88. $this->published = $published;
  89. }
  90. public function setUpdated($updated)
  91. {
  92. $this->updated = $updated;
  93. }
  94. public function setCreator($creator)
  95. {
  96. $this->creator = $creator;
  97. }
  98. }