AbstractLogEntry.php 3.5 KB

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