AbstractLogEntry.php 3.0 KB

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