AbstractLogEntry.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <?php
  2. namespace Gedmo\Loggable\Document\MappedSuperclass;
  3. use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoODM;
  4. /**
  5. * Gedmo\Loggable\Document\MappedSuperclass\AbstractLogEntry
  6. *
  7. * @MongoODM\MappedSuperclass
  8. */
  9. abstract class AbstractLogEntry
  10. {
  11. /**
  12. * @var integer $id
  13. *
  14. * @MongoODM\Id
  15. */
  16. protected $id;
  17. /**
  18. * @var string $action
  19. *
  20. * @MongoODM\String
  21. */
  22. protected $action;
  23. /**
  24. * @var \DateTime $loggedAt
  25. *
  26. * @MongoODM\Index
  27. * @MongoODM\Date
  28. */
  29. protected $loggedAt;
  30. /**
  31. * @var string $objectId
  32. *
  33. * @MongoODM\String(nullable=true)
  34. */
  35. protected $objectId;
  36. /**
  37. * @var string $objectClass
  38. *
  39. * @MongoODM\Index
  40. * @MongoODM\String
  41. */
  42. protected $objectClass;
  43. /**
  44. * @var integer $version
  45. *
  46. * @MongoODM\Int
  47. */
  48. protected $version;
  49. /**
  50. * @var string $data
  51. *
  52. * @MongoODM\Hash(nullable=true)
  53. */
  54. protected $data;
  55. /**
  56. * @var string $data
  57. *
  58. * @MongoODM\Index
  59. * @MongoODM\String(nullable=true)
  60. */
  61. protected $username;
  62. /**
  63. * Get id
  64. *
  65. * @return integer
  66. */
  67. public function getId()
  68. {
  69. return $this->id;
  70. }
  71. /**
  72. * Get action
  73. *
  74. * @return string
  75. */
  76. public function getAction()
  77. {
  78. return $this->action;
  79. }
  80. /**
  81. * Set action
  82. *
  83. * @param string $action
  84. */
  85. public function setAction($action)
  86. {
  87. $this->action = $action;
  88. }
  89. /**
  90. * Get object class
  91. *
  92. * @return string
  93. */
  94. public function getObjectClass()
  95. {
  96. return $this->objectClass;
  97. }
  98. /**
  99. * Set object class
  100. *
  101. * @param string $objectClass
  102. */
  103. public function setObjectClass($objectClass)
  104. {
  105. $this->objectClass = $objectClass;
  106. }
  107. /**
  108. * Get object id
  109. *
  110. * @return string
  111. */
  112. public function getObjectId()
  113. {
  114. return $this->objectId;
  115. }
  116. /**
  117. * Set object id
  118. *
  119. * @param string $objectId
  120. */
  121. public function setObjectId($objectId)
  122. {
  123. $this->objectId = $objectId;
  124. }
  125. /**
  126. * Get username
  127. *
  128. * @return string
  129. */
  130. public function getUsername()
  131. {
  132. return $this->username;
  133. }
  134. /**
  135. * Set username
  136. *
  137. * @param string $username
  138. */
  139. public function setUsername($username)
  140. {
  141. $this->username = $username;
  142. }
  143. /**
  144. * Get loggedAt
  145. *
  146. * @return \DateTime
  147. */
  148. public function getLoggedAt()
  149. {
  150. return $this->loggedAt;
  151. }
  152. /**
  153. * Set loggedAt to "now"
  154. */
  155. public function setLoggedAt()
  156. {
  157. $this->loggedAt = new \DateTime();
  158. }
  159. /**
  160. * Get data
  161. *
  162. * @return array or null
  163. */
  164. public function getData()
  165. {
  166. return $this->data;
  167. }
  168. /**
  169. * Set data
  170. *
  171. * @param array $data
  172. */
  173. public function setData($data)
  174. {
  175. $this->data = $data;
  176. }
  177. /**
  178. * Set current version
  179. *
  180. * @param integer $version
  181. */
  182. public function setVersion($version)
  183. {
  184. $this->version = $version;
  185. }
  186. /**
  187. * Get current version
  188. *
  189. * @return integer
  190. */
  191. public function getVersion()
  192. {
  193. return $this->version;
  194. }
  195. }