vendor/uvdesk/core-framework/Entity/Thread.php line 545

Open in your IDE?
  1. <?php
  2. namespace Webkul\UVDesk\CoreFrameworkBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * Thread
  6. *
  7. * @ORM\Entity(repositoryClass="Webkul\UVDesk\CoreFrameworkBundle\Repository\ThreadRepository")
  8. * @ORM\HasLifecycleCallbacks()
  9. * @ORM\Table(name="uv_thread")
  10. *
  11. */
  12. class Thread
  13. {
  14. /**
  15. * @var integer
  16. * @ORM\Id()
  17. * @ORM\Column(type="integer")
  18. * @ORM\GeneratedValue(strategy="AUTO")
  19. */
  20. private $id;
  21. /**
  22. * @var string
  23. * @ORM\Column(type="string", length=191)
  24. */
  25. private $source;
  26. /**
  27. * @var string
  28. * @ORM\Column(type="text", nullable=true)
  29. */
  30. private $messageId;
  31. /**
  32. * @var string
  33. * @ORM\Column(type="string", length=191)
  34. */
  35. private $threadType;
  36. /**
  37. * @var string
  38. * @ORM\Column(type="string", length=191)
  39. */
  40. private $createdBy;
  41. /**
  42. * @var array
  43. * @ORM\Column(type="array", nullable=true)
  44. */
  45. private $cc;
  46. /**
  47. * @var array
  48. * @ORM\Column(type="array", nullable=true)
  49. */
  50. private $bcc;
  51. /**
  52. * @var array
  53. * @ORM\Column(type="array", nullable=true)
  54. */
  55. private $replyTo;
  56. /**
  57. * @var string
  58. * @ORM\Column(type="string", length=255, nullable=true)
  59. */
  60. private $deliveryStatus;
  61. /**
  62. * @var boolean
  63. * @ORM\Column(type="boolean", options={"default": false})
  64. */
  65. private $isLocked = false;
  66. /**
  67. * @var boolean
  68. * @ORM\Column(type="boolean", options={"default": false})
  69. */
  70. private $isBookmarked = false;
  71. /**
  72. * @var string
  73. * @ORM\Column(type="text", nullable=true)
  74. */
  75. private $message;
  76. /**
  77. * @var \DateTime
  78. * @ORM\Column(type="datetime")
  79. */
  80. private $createdAt;
  81. /**
  82. * @var \DateTime
  83. * @ORM\Column(type="datetime")
  84. */
  85. private $updatedAt;
  86. /**
  87. * @var \DateTime
  88. * @ORM\Column(type="datetime", nullable=true)
  89. */
  90. private $agentViewedAt;
  91. /**
  92. * @var \DateTime
  93. * @ORM\Column(type="datetime", nullable=true)
  94. */
  95. private $customerViewedAt;
  96. /**
  97. * @var \Webkul\UVDesk\CoreFrameworkBundle\Entity\Ticket
  98. * @ORM\ManyToOne(targetEntity="Ticket", inversedBy="threads")
  99. * @ORM\JoinColumn(name="ticket_id", referencedColumnName="id", onDelete="CASCADE")
  100. */
  101. private $ticket;
  102. /**
  103. * @var \Webkul\UVDesk\CoreFrameworkBundle\Entity\User
  104. * @ORM\ManyToOne(targetEntity="User")
  105. * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="SET NULL")
  106. */
  107. private $user;
  108. /**
  109. * @var \Webkul\UVDesk\CoreFrameworkBundle\Entity\Attachment
  110. * @ORM\OneToMany(targetEntity="Attachment", mappedBy="thread", cascade={"remove"}, orphanRemoval=true)
  111. */
  112. private $attachments;
  113. /**
  114. * Constructor
  115. */
  116. public function __construct()
  117. {
  118. $this->attachments = new \Doctrine\Common\Collections\ArrayCollection();
  119. }
  120. /**
  121. * Get id
  122. *
  123. * @return integer
  124. */
  125. public function getId()
  126. {
  127. return $this->id;
  128. }
  129. /**
  130. * Set source
  131. *
  132. * @param string $source
  133. *
  134. * @return Thread
  135. */
  136. public function setSource($source)
  137. {
  138. $this->source = $source;
  139. return $this;
  140. }
  141. /**
  142. * Get source
  143. *
  144. * @return string
  145. */
  146. public function getSource()
  147. {
  148. return $this->source;
  149. }
  150. /**
  151. * Set messageId
  152. *
  153. * @param string $messageId
  154. *
  155. * @return Thread
  156. */
  157. public function setMessageId($messageId)
  158. {
  159. $this->messageId = $messageId;
  160. return $this;
  161. }
  162. /**
  163. * Get messageId
  164. *
  165. * @return string
  166. */
  167. public function getMessageId()
  168. {
  169. return $this->messageId;
  170. }
  171. /**
  172. * Set threadType
  173. *
  174. * @param string $threadType
  175. *
  176. * @return Thread
  177. */
  178. public function setThreadType($threadType)
  179. {
  180. $this->threadType = $threadType;
  181. return $this;
  182. }
  183. /**
  184. * Get threadType
  185. *
  186. * @return string
  187. */
  188. public function getThreadType()
  189. {
  190. return $this->threadType;
  191. }
  192. /**
  193. * Set createdBy
  194. *
  195. * @param string $createdBy
  196. *
  197. * @return Thread
  198. */
  199. public function setCreatedBy($createdBy)
  200. {
  201. $this->createdBy = $createdBy;
  202. return $this;
  203. }
  204. /**
  205. * Get createdBy
  206. *
  207. * @return string
  208. */
  209. public function getCreatedBy()
  210. {
  211. return $this->createdBy;
  212. }
  213. /**
  214. * Set cc
  215. *
  216. * @param array $cc
  217. *
  218. * @return Thread
  219. */
  220. public function setCc($cc)
  221. {
  222. $this->cc = $cc;
  223. return $this;
  224. }
  225. /**
  226. * Get cc
  227. *
  228. * @return array
  229. */
  230. public function getCc()
  231. {
  232. return $this->cc;
  233. }
  234. /**
  235. * Set bcc
  236. *
  237. * @param array $bcc
  238. *
  239. * @return Thread
  240. */
  241. public function setBcc($bcc)
  242. {
  243. $this->bcc = $bcc;
  244. return $this;
  245. }
  246. /**
  247. * Get bcc
  248. *
  249. * @return array
  250. */
  251. public function getBcc()
  252. {
  253. return $this->bcc;
  254. }
  255. /**
  256. * Set replyTo
  257. *
  258. * @param array $replyTo
  259. *
  260. * @return Thread
  261. */
  262. public function setReplyTo($replyTo)
  263. {
  264. $this->replyTo = $replyTo;
  265. return $this;
  266. }
  267. /**
  268. * Get replyTo
  269. *
  270. * @return array
  271. */
  272. public function getReplyTo()
  273. {
  274. return $this->replyTo;
  275. }
  276. /**
  277. * Set deliveryStatus
  278. *
  279. * @param string $deliveryStatus
  280. *
  281. * @return Thread
  282. */
  283. public function setDeliveryStatus($deliveryStatus)
  284. {
  285. $this->deliveryStatus = $deliveryStatus;
  286. return $this;
  287. }
  288. /**
  289. * Get deliveryStatus
  290. *
  291. * @return string
  292. */
  293. public function getDeliveryStatus()
  294. {
  295. return $this->deliveryStatus;
  296. }
  297. /**
  298. * Set isLocked
  299. *
  300. * @param boolean $isLocked
  301. *
  302. * @return Thread
  303. */
  304. public function setIsLocked($isLocked)
  305. {
  306. $this->isLocked = $isLocked;
  307. return $this;
  308. }
  309. /**
  310. * Get isLocked
  311. *
  312. * @return boolean
  313. */
  314. public function getIsLocked()
  315. {
  316. return $this->isLocked;
  317. }
  318. /**
  319. * Set isBookmarked
  320. *
  321. * @param boolean $isBookmarked
  322. *
  323. * @return Thread
  324. */
  325. public function setIsBookmarked($isBookmarked)
  326. {
  327. $this->isBookmarked = $isBookmarked;
  328. return $this;
  329. }
  330. /**
  331. * Get isBookmarked
  332. *
  333. * @return boolean
  334. */
  335. public function getIsBookmarked()
  336. {
  337. return $this->isBookmarked;
  338. }
  339. /**
  340. * Set message
  341. *
  342. * @param string $message
  343. *
  344. * @return Thread
  345. */
  346. public function setMessage($message)
  347. {
  348. $this->message = $message;
  349. return $this;
  350. }
  351. /**
  352. * Get message
  353. *
  354. * @return string
  355. */
  356. public function getMessage()
  357. {
  358. $sanitizer = new \App\Service\MailHtmlSanitizer();
  359. return $sanitizer->sanitize($this->message);
  360. }
  361. /**
  362. * Set createdAt
  363. *
  364. * @param \DateTime $createdAt
  365. *
  366. * @return Thread
  367. */
  368. public function setCreatedAt($createdAt)
  369. {
  370. $this->createdAt = $createdAt;
  371. return $this;
  372. }
  373. /**
  374. * Get createdAt
  375. *
  376. * @return \DateTime
  377. */
  378. public function getCreatedAt()
  379. {
  380. return $this->createdAt;
  381. }
  382. /**
  383. * Set updatedAt
  384. *
  385. * @param \DateTime $updatedAt
  386. *
  387. * @return Thread
  388. */
  389. public function setUpdatedAt($updatedAt)
  390. {
  391. $this->updatedAt = $updatedAt;
  392. return $this;
  393. }
  394. /**
  395. * Get updatedAt
  396. *
  397. * @return \DateTime
  398. */
  399. public function getUpdatedAt()
  400. {
  401. return $this->updatedAt;
  402. }
  403. /**
  404. * Set agentViewedAt
  405. *
  406. * @param \DateTime $agentViewedAt
  407. *
  408. * @return Thread
  409. */
  410. public function setAgentViewedAt($agentViewedAt)
  411. {
  412. $this->agentViewedAt = $agentViewedAt;
  413. return $this;
  414. }
  415. /**
  416. * Get agentViewedAt
  417. *
  418. * @return \DateTime
  419. */
  420. public function getAgentViewedAt()
  421. {
  422. return $this->agentViewedAt;
  423. }
  424. /**
  425. * Set customerViewedAt
  426. *
  427. * @param \DateTime $customerViewedAt
  428. *
  429. * @return Thread
  430. */
  431. public function setCustomerViewedAt($customerViewedAt)
  432. {
  433. $this->customerViewedAt = $customerViewedAt;
  434. return $this;
  435. }
  436. /**
  437. * Get customerViewedAt
  438. *
  439. * @return \DateTime
  440. */
  441. public function getCustomerViewedAt()
  442. {
  443. return $this->customerViewedAt;
  444. }
  445. /**
  446. * Set ticket
  447. *
  448. * @param \Webkul\UVDesk\CoreFrameworkBundle\Entity\Ticket $ticket
  449. *
  450. * @return Thread
  451. */
  452. public function setTicket(\Webkul\UVDesk\CoreFrameworkBundle\Entity\Ticket $ticket = null)
  453. {
  454. $this->ticket = $ticket;
  455. return $this;
  456. }
  457. /**
  458. * Get ticket
  459. *
  460. * @return \Webkul\UVDesk\CoreFrameworkBundle\Entity\Ticket
  461. */
  462. public function getTicket()
  463. {
  464. return $this->ticket;
  465. }
  466. /**
  467. * Set user
  468. *
  469. * @param \Webkul\UVDesk\CoreFrameworkBundle\Entity\User $user
  470. *
  471. * @return Thread
  472. */
  473. public function setUser(\Webkul\UVDesk\CoreFrameworkBundle\Entity\User $user = null)
  474. {
  475. $this->user = $user;
  476. return $this;
  477. }
  478. /**
  479. * Get user
  480. *
  481. * @return \Webkul\UVDesk\CoreFrameworkBundle\Entity\User
  482. */
  483. public function getUser()
  484. {
  485. return $this->user;
  486. }
  487. /**
  488. * Add attachments
  489. *
  490. * @param \Webkul\UVDesk\CoreFrameworkBundle\Entity\Attachment $attachments
  491. * @return Thread
  492. */
  493. public function addAttachment(\Webkul\UVDesk\CoreFrameworkBundle\Entity\Attachment $attachments)
  494. {
  495. $this->attachments[] = $attachments;
  496. return $this;
  497. }
  498. /**
  499. * Remove attachments
  500. *
  501. * @param \Webkul\TicketBundle\Entity\Attachment $attachments
  502. */
  503. public function removeAttachment(\Webkul\UVDesk\CoreFrameworkBundle\Entity\Attachment $attachments)
  504. {
  505. $this->attachments->removeElement($attachments);
  506. }
  507. /**
  508. * Get attachments
  509. *
  510. * @return \Doctrine\Common\Collections\Collection
  511. */
  512. public function getAttachments()
  513. {
  514. return $this->attachments;
  515. }
  516. }