AbstractLogEntry.php 3.4 KB

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