AbstractLogEntry.php 3.4 KB

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