vendor/uvdesk/core-framework/Entity/SupportGroup.php line 13

Open in your IDE?
  1. <?php
  2. namespace Webkul\UVDesk\CoreFrameworkBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * SupportGroup
  6. * @ORM\Entity(repositoryClass="Webkul\UVDesk\CoreFrameworkBundle\Repository\SupportGroupRepository")
  7. * @ORM\HasLifecycleCallbacks
  8. * @ORM\Table(name="uv_support_group")
  9. */
  10. class SupportGroup
  11. {
  12. /**
  13. * @var integer
  14. * @ORM\Id()
  15. * @ORM\Column(type="integer")
  16. * @ORM\GeneratedValue(strategy="AUTO")
  17. *
  18. */
  19. private $id;
  20. /**
  21. * @var string
  22. * @ORM\Column(name="name", type="string", length=191)
  23. */
  24. private $name;
  25. /**
  26. * @var string
  27. * @ORM\Column(name="description", type="text")
  28. */
  29. private $description;
  30. /**
  31. * @var \DateTime
  32. * @ORM\Column(name="created_at", type="datetime")
  33. */
  34. private $createdAt;
  35. /**
  36. * @var boolean
  37. * @ORM\Column(name="is_active", type="boolean", options={"default": false})
  38. */
  39. private $isActive = false;
  40. /**
  41. * @var boolean
  42. * @ORM\Column(name="user_view", type="boolean", options={"default": false})
  43. */
  44. private $userView = false;
  45. /**
  46. * @var \Doctrine\Common\Collections\Collection
  47. *
  48. * @ORM\ManyToMany(targetEntity="UserInstance", mappedBy="supportGroups")
  49. */
  50. private $users;
  51. /**
  52. * @var \Doctrine\Common\Collections\Collection
  53. * @ORM\ManyToMany(targetEntity="UserInstance", mappedBy="adminSupportGroups")
  54. */
  55. private $admins;
  56. /**
  57. * @var \Doctrine\Common\Collections\Collection
  58. * @ORM\ManyToMany(targetEntity="SupportTeam", inversedBy="supportGroups")
  59. * @ORM\JoinTable(
  60. * name="uv_support_groups_teams",
  61. * joinColumns={@ORM\JoinColumn(name="supportGroup_id", referencedColumnName="id", onDelete="CASCADE")},
  62. * inverseJoinColumns={@ORM\JoinColumn(name="supportTeam_id", referencedColumnName="id", onDelete="CASCADE")}
  63. * )
  64. */
  65. private $supportTeams;
  66. /**
  67. * Constructor
  68. */
  69. public function __construct()
  70. {
  71. $this->users = new \Doctrine\Common\Collections\ArrayCollection();
  72. $this->admins = new \Doctrine\Common\Collections\ArrayCollection();
  73. $this->supportTeams = new \Doctrine\Common\Collections\ArrayCollection();
  74. }
  75. /**
  76. * Get id
  77. *
  78. * @return integer
  79. */
  80. public function getId()
  81. {
  82. return $this->id;
  83. }
  84. /**
  85. * Set name
  86. *
  87. * @param string $name
  88. *
  89. * @return SupportGroup
  90. */
  91. public function setName($name)
  92. {
  93. $this->name = $name;
  94. return $this;
  95. }
  96. /**
  97. * Get name
  98. *
  99. * @return string
  100. */
  101. public function getName()
  102. {
  103. return $this->name;
  104. }
  105. /**
  106. * Set description
  107. *
  108. * @param string $description
  109. *
  110. * @return SupportGroup
  111. */
  112. public function setDescription($description)
  113. {
  114. $this->description = $description;
  115. return $this;
  116. }
  117. /**
  118. * Get description
  119. *
  120. * @return string
  121. */
  122. public function getDescription()
  123. {
  124. return $this->description;
  125. }
  126. /**
  127. * Set createdAt
  128. *
  129. * @param \DateTime $createdAt
  130. *
  131. * @return SupportGroup
  132. */
  133. public function setCreatedAt($createdAt)
  134. {
  135. $this->createdAt = $createdAt;
  136. return $this;
  137. }
  138. /**
  139. * Get createdAt
  140. *
  141. * @return \DateTime
  142. */
  143. public function getCreatedAt()
  144. {
  145. return $this->createdAt;
  146. }
  147. /**
  148. * Set isActive
  149. *
  150. * @param boolean $isActive
  151. *
  152. * @return SupportGroup
  153. */
  154. public function setIsActive($isActive)
  155. {
  156. $this->isActive = $isActive;
  157. return $this;
  158. }
  159. /**
  160. * Get isActive
  161. *
  162. * @return boolean
  163. */
  164. public function getIsActive()
  165. {
  166. return $this->isActive;
  167. }
  168. /**
  169. * Set userView
  170. *
  171. * @param boolean $userView
  172. *
  173. * @return SupportGroup
  174. */
  175. public function setUserView($userView)
  176. {
  177. $this->userView = $userView;
  178. return $this;
  179. }
  180. /**
  181. * Get userView
  182. *
  183. * @return boolean
  184. */
  185. public function getUserView()
  186. {
  187. return $this->userView;
  188. }
  189. /**
  190. * Add user
  191. *
  192. * @param \Webkul\UVDesk\CoreFrameworkBundle\Entity\UserInstance $user
  193. *
  194. * @return SupportGroup
  195. */
  196. public function addUser(\Webkul\UVDesk\CoreFrameworkBundle\Entity\UserInstance $user)
  197. {
  198. $this->users[] = $user;
  199. return $this;
  200. }
  201. /**
  202. * Remove user
  203. *
  204. * @param \Webkul\UVDesk\CoreFrameworkBundle\Entity\UserInstance $user
  205. */
  206. public function removeUser(\Webkul\UVDesk\CoreFrameworkBundle\Entity\UserInstance $user)
  207. {
  208. $this->users->removeElement($user);
  209. }
  210. /**
  211. * Get users
  212. *
  213. * @return \Doctrine\Common\Collections\Collection
  214. */
  215. public function getUsers()
  216. {
  217. return $this->users;
  218. }
  219. /**
  220. * Add admin
  221. *
  222. * @param \Webkul\UVDesk\CoreFrameworkBundle\Entity\UserInstance $admin
  223. *
  224. * @return SupportGroup
  225. */
  226. public function addAdmin(\Webkul\UVDesk\CoreFrameworkBundle\Entity\UserInstance $admin)
  227. {
  228. $this->admins[] = $admin;
  229. return $this;
  230. }
  231. /**
  232. * Remove admin
  233. *
  234. * @param \Webkul\UVDesk\CoreFrameworkBundle\Entity\UserInstance $admin
  235. */
  236. public function removeAdmin(\Webkul\UVDesk\CoreFrameworkBundle\Entity\UserInstance $admin)
  237. {
  238. $this->admins->removeElement($admin);
  239. }
  240. /**
  241. * Get admins
  242. *
  243. * @return \Doctrine\Common\Collections\Collection
  244. */
  245. public function getAdmins()
  246. {
  247. return $this->admins;
  248. }
  249. /**
  250. * Add supportTeam
  251. *
  252. * @param \Webkul\UVDesk\CoreFrameworkBundle\Entity\SupportTeam $supportTeam
  253. *
  254. * @return SupportGroup
  255. */
  256. public function addSupportTeam(\Webkul\UVDesk\CoreFrameworkBundle\Entity\SupportTeam $supportTeam)
  257. {
  258. $this->supportTeams[] = $supportTeam;
  259. return $this;
  260. }
  261. /**
  262. * Remove supportTeam
  263. *
  264. * @param \Webkul\UVDesk\CoreFrameworkBundle\Entity\SupportTeam $supportTeam
  265. */
  266. public function removeSupportTeam(\Webkul\UVDesk\CoreFrameworkBundle\Entity\SupportTeam $supportTeam)
  267. {
  268. $this->supportTeams->removeElement($supportTeam);
  269. }
  270. /**
  271. * Get supportTeams
  272. *
  273. * @return \Doctrine\Common\Collections\Collection
  274. */
  275. public function getSupportTeams()
  276. {
  277. return $this->supportTeams;
  278. }
  279. /**
  280. * @ORM\PrePersist
  281. */
  282. public function initializeTimestamp()
  283. {
  284. $this->createdAt = new \DateTime('now');
  285. }
  286. }