vendor/uvdesk/support-center-bundle/Entity/Solutions.php line 13

Open in your IDE?
  1. <?php
  2. namespace Webkul\UVDesk\SupportCenterBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * Solutions
  6. * @ORM\Entity(repositoryClass="Webkul\UVDesk\SupportCenterBundle\Repository\Solutions")
  7. * @ORM\HasLifecycleCallbacks
  8. * @ORM\Table(name="uv_solutions")
  9. */
  10. class Solutions
  11. {
  12. /**
  13. * @var int
  14. * @ORM\Id
  15. * @ORM\Column(type="integer")
  16. * @ORM\GeneratedValue
  17. */
  18. private $id;
  19. /**
  20. * @var string
  21. * @ORM\Column(type="string", length=255)
  22. */
  23. private $name;
  24. /**
  25. * @var string
  26. * @ORM\Column(type="string", length=255)
  27. */
  28. private $description;
  29. /**
  30. * @var string
  31. * @ORM\Column(type="string", length=255)
  32. */
  33. private $visibility;
  34. /**
  35. * @var int
  36. * @ORM\Column(type="integer", options={"default": 5})
  37. */
  38. private $sortOrder;
  39. /**
  40. * Get id.
  41. *
  42. * @return int
  43. */
  44. public function getId()
  45. {
  46. return $this->id;
  47. }
  48. /**
  49. * Set name.
  50. *
  51. * @param string $name
  52. *
  53. * @return Solutions
  54. */
  55. public function setName($name)
  56. {
  57. $this->name = $name;
  58. return $this;
  59. }
  60. /**
  61. * Get name.
  62. *
  63. * @return string
  64. */
  65. public function getName()
  66. {
  67. return $this->name;
  68. }
  69. /**
  70. * Set description.
  71. *
  72. * @param string $description
  73. *
  74. * @return Solutions
  75. */
  76. public function setDescription($description)
  77. {
  78. $this->description = $description;
  79. return $this;
  80. }
  81. /**
  82. * Get description.
  83. *
  84. * @return string
  85. */
  86. public function getDescription()
  87. {
  88. return $this->description;
  89. }
  90. /**
  91. * Set visibility.
  92. *
  93. * @param string $visibility
  94. *
  95. * @return Solutions
  96. */
  97. public function setVisibility($visibility)
  98. {
  99. $this->visibility = $visibility;
  100. return $this;
  101. }
  102. /**
  103. * Get visibility.
  104. *
  105. * @return string
  106. */
  107. public function getVisibility()
  108. {
  109. return $this->visibility;
  110. }
  111. /**
  112. * Set sortOrder.
  113. *
  114. * @param int $sortOrder
  115. *
  116. * @return Solutions
  117. */
  118. public function setSortOrder($sortOrder)
  119. {
  120. $this->sortOrder = $sortOrder;
  121. return $this;
  122. }
  123. /**
  124. * Get sortOrder.
  125. *
  126. * @return int
  127. */
  128. public function getSortOrder()
  129. {
  130. return $this->sortOrder;
  131. }
  132. /**
  133. * @var \DateTime
  134. * @ORM\Column(type="datetime")
  135. */
  136. private $dateAdded;
  137. /**
  138. * @var \DateTime
  139. * @ORM\Column(type="datetime")
  140. */
  141. private $dateUpdated;
  142. /**
  143. * @var string|null
  144. * @ORM\Column(type="string", length=255, nullable=true)
  145. */
  146. private $solutionImage;
  147. /**
  148. * Set dateAdded.
  149. *
  150. * @param \DateTime $dateAdded
  151. *
  152. * @return Solutions
  153. */
  154. public function setDateAdded($dateAdded)
  155. {
  156. $this->dateAdded = $dateAdded;
  157. return $this;
  158. }
  159. /**
  160. * Get dateAdded.
  161. *
  162. * @return \DateTime
  163. */
  164. public function getDateAdded()
  165. {
  166. return $this->dateAdded;
  167. }
  168. /**
  169. * Set dateUpdated.
  170. *
  171. * @param \DateTime $dateUpdated
  172. *
  173. * @return Solutions
  174. */
  175. public function setDateUpdated($dateUpdated)
  176. {
  177. $this->dateUpdated = $dateUpdated;
  178. return $this;
  179. }
  180. /**
  181. * Get dateUpdated.
  182. *
  183. * @return \DateTime
  184. */
  185. public function getDateUpdated()
  186. {
  187. return $this->dateUpdated;
  188. }
  189. /**
  190. * Set solutionImage.
  191. *
  192. * @param string|null $solutionImage
  193. *
  194. * @return Solutions
  195. */
  196. public function setSolutionImage($solutionImage = null)
  197. {
  198. $this->solutionImage = $solutionImage;
  199. return $this;
  200. }
  201. /**
  202. * Get solutionImage.
  203. *
  204. * @return string|null
  205. */
  206. public function getSolutionImage()
  207. {
  208. return $this->solutionImage;
  209. }
  210. //file upload
  211. public function upload($file, $container)
  212. {
  213. $container->get('file.service')->setRequiredFileSystem();
  214. $container->get('file.service')->upload($file);
  215. }
  216. public function removeUpload($file, $container)
  217. {
  218. if ($this->{$file} and file_exists($this->{$file})) {
  219. //call service
  220. $container->get('file.service')->removeUpload($file);
  221. }
  222. }
  223. }