src/Document/Mutation.php line 303

Open in your IDE?
  1. <?php
  2. namespace App\Document;
  3. use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
  4. use JsonSerializable;
  5. /**
  6. * @MongoDB\Document(repositoryClass="App\Repository\MutationRepository", collection="mutation")
  7. */
  8. class Mutation implements JsonSerializable
  9. {
  10. /**
  11. * @MongoDB\Id
  12. */
  13. protected $_id;
  14. /**
  15. * @var string one of create | update | delete
  16. * @MongoDB\Field(type="string")
  17. */
  18. private $action;
  19. /**
  20. * @var string one of pristine | ready | processed | cancelled
  21. * @MongoDB\Field(type="string")
  22. */
  23. private $state;
  24. /**
  25. * @var string
  26. * @MongoDB\Field(type="string")
  27. */
  28. private $entityType;
  29. /**
  30. * @var string|null
  31. * @MongoDB\Field(type="string", nullable=true)
  32. */
  33. private $entityId;
  34. /**
  35. * @var string
  36. * @MongoDB\Field(type="string", nullable=false)
  37. */
  38. private $entityGitId;
  39. /**
  40. * @var string
  41. * @MongoDB\Field(type="string", nullable=true)
  42. */
  43. protected $entityGitParentId;
  44. /**
  45. * @var string
  46. * @MongoDB\Field(type="string", nullable=true)
  47. */
  48. protected $entityGitParentPath;
  49. /**
  50. * @var object
  51. * @MongoDB\Field(type="hash")
  52. */
  53. private $oldValue;
  54. /**
  55. * @var object
  56. * @MongoDB\Field(type="hash", nullable="true")
  57. */
  58. private $newValue;
  59. /**
  60. * @var string
  61. * @MongoDB\Field(type="string")
  62. */
  63. private $user;
  64. /**
  65. * @var \DateTime
  66. * @MongoDB\Field(type="date")
  67. */
  68. private $lastUpdate;
  69. /**
  70. * @return mixed
  71. */
  72. public function getId()
  73. {
  74. return $this->_id;
  75. }
  76. /**
  77. * @param mixed $id
  78. * @return Mutation
  79. */
  80. public function setId($id)
  81. {
  82. $this->_id = $id;
  83. return $this;
  84. }
  85. /**
  86. * @return string
  87. */
  88. public function getEntityId(): ?string
  89. {
  90. return $this->entityId;
  91. }
  92. /**
  93. * @param string $entityId
  94. * @return Mutation
  95. */
  96. public function setEntityId(string $entityId = null): Mutation
  97. {
  98. $this->entityId = $entityId;
  99. return $this;
  100. }
  101. /**
  102. * @return string
  103. */
  104. public function getEntityGitId(): string
  105. {
  106. return $this->entityGitId;
  107. }
  108. /**
  109. * @param string $entityGitId
  110. * @return Mutation
  111. */
  112. public function setEntityGitId(string $entityGitId): Mutation
  113. {
  114. $this->entityGitId = $entityGitId;
  115. return $this;
  116. }
  117. /**
  118. * @return string
  119. */
  120. public function getEntityGitParentId(): ?string
  121. {
  122. return $this->entityGitParentId;
  123. }
  124. /**
  125. * @param string $entityGitParentId
  126. * @return Mutation
  127. */
  128. public function setEntityGitParentId(string $entityGitParentId): Mutation
  129. {
  130. $this->entityGitParentId = $entityGitParentId;
  131. return $this;
  132. }
  133. /**
  134. * @return string
  135. */
  136. public function getEntityGitParentPath(): ?string
  137. {
  138. return $this->entityGitParentPath;
  139. }
  140. /**
  141. * @param string $entityGitParentPath
  142. * @return Mutation
  143. */
  144. public function setEntityGitParentPath(string $entityGitParentPath): Mutation
  145. {
  146. $this->entityGitParentPath = $entityGitParentPath;
  147. return $this;
  148. }
  149. /**
  150. * @return string
  151. */
  152. public function getEntityType(): string
  153. {
  154. return $this->entityType;
  155. }
  156. /**
  157. * @param string $entityType
  158. * @return Mutation
  159. */
  160. public function setEntityType(string $entityType): Mutation
  161. {
  162. $this->entityType = $entityType;
  163. return $this;
  164. }
  165. /**
  166. * @return object
  167. */
  168. public function getOldValue(): array
  169. {
  170. return $this->oldValue;
  171. }
  172. /**
  173. * @param object $oldValue
  174. * @return Mutation
  175. */
  176. public function setOldValue(array $oldValue): Mutation
  177. {
  178. $this->oldValue = $oldValue;
  179. return $this;
  180. }
  181. /**
  182. * @return array
  183. */
  184. public function getNewValue(): ?array
  185. {
  186. return $this->newValue;
  187. }
  188. /**
  189. * @param object $newValue
  190. * @return Mutation
  191. */
  192. public function setNewValue(array $newValue): Mutation
  193. {
  194. $this->newValue = $newValue;
  195. return $this;
  196. }
  197. /**
  198. * @return string
  199. */
  200. public function getUser(): string
  201. {
  202. return $this->user;
  203. }
  204. /**
  205. * @param string $user
  206. * @return Mutation
  207. */
  208. public function setUser(string $user): Mutation
  209. {
  210. $this->user = $user;
  211. return $this;
  212. }
  213. /**
  214. * @return string
  215. */
  216. public function getAction(): string
  217. {
  218. return $this->action;
  219. }
  220. /**
  221. * @param string $action
  222. * @return Mutation
  223. */
  224. public function setAction(string $action): Mutation
  225. {
  226. $this->action = $action;
  227. return $this;
  228. }
  229. /**
  230. * @return string
  231. */
  232. public function getState(): string
  233. {
  234. return $this->state;
  235. }
  236. /**
  237. * @param string $state
  238. * @return Mutation
  239. */
  240. public function setState(string $state): Mutation
  241. {
  242. $this->state = $state;
  243. return $this;
  244. }
  245. /**
  246. * @return \DateTime
  247. */
  248. public function getLastUpdate(): \DateTime
  249. {
  250. return $this->lastUpdate;
  251. }
  252. /**
  253. * @param \DateTime $lastUpdate
  254. * @return Mutation
  255. */
  256. public function setLastUpdate(\DateTime $lastUpdate): Mutation
  257. {
  258. $this->lastUpdate = $lastUpdate;
  259. return $this;
  260. }
  261. public function jsonSerialize()
  262. {
  263. return [
  264. 'id' => 1,
  265. ];
  266. }
  267. }