CarePost.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. namespace Chamilo\PluginBundle\Entity\StudentFollowUp;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. /**
  7. * CarePost.
  8. *
  9. * @ORM\Table(name="sfu_post")
  10. * @ORM\Entity
  11. * @Gedmo\Tree(type="nested")
  12. */
  13. class CarePost
  14. {
  15. /**
  16. * @var int
  17. *
  18. * @ORM\Column(name="id", type="integer")
  19. * @ORM\Id
  20. * @ORM\GeneratedValue
  21. */
  22. protected $id;
  23. /**
  24. * @var string
  25. *
  26. * @ORM\Column(name="title", type="string", length=255, nullable=false)
  27. */
  28. protected $title;
  29. /**
  30. * @var string
  31. *
  32. * @ORM\Column(name="content", type="text", nullable=true)
  33. */
  34. protected $content;
  35. /**
  36. * @var string
  37. *
  38. * @ORM\Column(name="external_care_id", type="string", nullable=true)
  39. */
  40. protected $externalCareId;
  41. /**
  42. * @ORM\Column(name="created_at", type="datetime", nullable=true)
  43. */
  44. protected $createdAt;
  45. /**
  46. * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  47. */
  48. protected $updatedAt;
  49. /**
  50. * @var bool
  51. *
  52. * @ORM\Column(name="private", type="boolean")
  53. */
  54. protected $private;
  55. /**
  56. * @var bool
  57. *
  58. * @ORM\Column(name="external_source", type="boolean")
  59. */
  60. protected $externalSource;
  61. /**
  62. * @var array
  63. *
  64. * @ORM\Column(name="tags", type="array")
  65. */
  66. protected $tags;
  67. /**
  68. * @var string
  69. *
  70. * @ORM\Column(name="attachment", type="string", length=255)
  71. */
  72. protected $attachment;
  73. /**
  74. * @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", cascade={"persist"})
  75. * @ORM\JoinColumn(name="insert_user_id", referencedColumnName="id", nullable=false)
  76. */
  77. private $insertUser;
  78. /**
  79. * @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", cascade={"persist"})
  80. * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
  81. */
  82. private $user;
  83. /**
  84. * @Gedmo\TreeParent
  85. * @ORM\ManyToOne(targetEntity="CarePost", inversedBy="children")
  86. * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="SET NULL")
  87. */
  88. private $parent;
  89. /**
  90. * @ORM\OneToMany(targetEntity="CarePost", mappedBy="parent")
  91. * @ORM\OrderBy({"createdAt" = "DESC"})
  92. */
  93. private $children;
  94. /**
  95. * @var int
  96. * @Gedmo\TreeLeft
  97. * @ORM\Column(name="lft", type="integer", nullable=true, unique=false)
  98. */
  99. private $lft;
  100. /**
  101. * @var int
  102. * @Gedmo\TreeRight
  103. * @ORM\Column(name="rgt", type="integer", nullable=true, unique=false)
  104. */
  105. private $rgt;
  106. /**
  107. * @var int
  108. * @Gedmo\TreeLevel
  109. * @ORM\Column(name="lvl", type="integer", nullable=true, unique=false)
  110. */
  111. private $lvl;
  112. /**
  113. * @var int
  114. * @Gedmo\TreeRoot
  115. * @ORM\Column(name="root", type="integer", nullable=true, unique=false)
  116. */
  117. private $root;
  118. /**
  119. * Project constructor.
  120. */
  121. public function __construct()
  122. {
  123. $this->createdAt = new \DateTime();
  124. $this->attachment = '';
  125. }
  126. /**
  127. * @return int
  128. */
  129. public function getId()
  130. {
  131. return $this->id;
  132. }
  133. /**
  134. * @param int $id
  135. *
  136. * @return $this
  137. */
  138. public function setId($id)
  139. {
  140. $this->id = $id;
  141. return $this;
  142. }
  143. /**
  144. * @return string
  145. */
  146. public function getTitle()
  147. {
  148. return $this->title;
  149. }
  150. /**
  151. * @param string $title
  152. *
  153. * @return CarePost
  154. */
  155. public function setTitle($title)
  156. {
  157. $this->title = $title;
  158. return $this;
  159. }
  160. /**
  161. * @return string
  162. */
  163. public function getContent()
  164. {
  165. return $this->content;
  166. }
  167. /**
  168. * @param string $content
  169. *
  170. * @return CarePost
  171. */
  172. public function setContent($content)
  173. {
  174. $this->content = $content;
  175. return $this;
  176. }
  177. /**
  178. * @return string
  179. */
  180. public function getExternalCareId()
  181. {
  182. return $this->externalCareId;
  183. }
  184. /**
  185. * @param string $externalCareId
  186. *
  187. * @return CarePost
  188. */
  189. public function setExternalCareId($externalCareId)
  190. {
  191. $this->externalCareId = $externalCareId;
  192. return $this;
  193. }
  194. /**
  195. * @return mixed
  196. */
  197. public function getUser()
  198. {
  199. return $this->user;
  200. }
  201. /**
  202. * @param mixed $user
  203. *
  204. * @return CarePost
  205. */
  206. public function setUser($user)
  207. {
  208. $this->user = $user;
  209. return $this;
  210. }
  211. /**
  212. * @return bool
  213. */
  214. public function isPrivate()
  215. {
  216. return $this->private;
  217. }
  218. /**
  219. * @param bool $private
  220. *
  221. * @return CarePost
  222. */
  223. public function setPrivate($private)
  224. {
  225. $this->private = $private;
  226. return $this;
  227. }
  228. /**
  229. * @return bool
  230. */
  231. public function isExternalSource()
  232. {
  233. return $this->externalSource;
  234. }
  235. /**
  236. * @param bool $externalSource
  237. *
  238. * @return CarePost
  239. */
  240. public function setExternalSource($externalSource)
  241. {
  242. $this->externalSource = $externalSource;
  243. return $this;
  244. }
  245. /**
  246. * @return string
  247. */
  248. public function getAttachment()
  249. {
  250. return $this->attachment;
  251. }
  252. /**
  253. * @param string $attachment
  254. *
  255. * @return CarePost
  256. */
  257. public function setAttachment($attachment)
  258. {
  259. $this->attachment = $attachment;
  260. return $this;
  261. }
  262. /**
  263. * @return mixed
  264. */
  265. public function getParent()
  266. {
  267. return $this->parent;
  268. }
  269. /**
  270. * @param mixed $parent
  271. *
  272. * @return CarePost
  273. */
  274. public function setParent($parent)
  275. {
  276. $this->parent = $parent;
  277. return $this;
  278. }
  279. /**
  280. * @return int
  281. */
  282. public function hasParent()
  283. {
  284. return !empty($this->parent) ? 1 : 0;
  285. }
  286. /**
  287. * @return mixed
  288. */
  289. public function getChildren()
  290. {
  291. return $this->children;
  292. }
  293. /**
  294. * @param mixed $children
  295. *
  296. * @return CarePost
  297. */
  298. public function setChildren($children)
  299. {
  300. $this->children = $children;
  301. return $this;
  302. }
  303. /**
  304. * @return mixed
  305. */
  306. public function getCreatedAt()
  307. {
  308. return $this->createdAt;
  309. }
  310. /**
  311. * @param mixed $createdAt
  312. *
  313. * @return CarePost
  314. */
  315. public function setCreatedAt($createdAt)
  316. {
  317. $this->createdAt = $createdAt;
  318. return $this;
  319. }
  320. /**
  321. * @return mixed
  322. */
  323. public function getUpdatedAt()
  324. {
  325. return $this->updatedAt;
  326. }
  327. /**
  328. * @param mixed $updatedAt
  329. *
  330. * @return CarePost
  331. */
  332. public function setUpdatedAt($updatedAt)
  333. {
  334. $this->updatedAt = $updatedAt;
  335. return $this;
  336. }
  337. /**
  338. * @return array
  339. */
  340. public function getTags()
  341. {
  342. return $this->tags;
  343. }
  344. /**
  345. * @param array $tags
  346. *
  347. * @return CarePost
  348. */
  349. public function setTags($tags)
  350. {
  351. $this->tags = $tags;
  352. return $this;
  353. }
  354. /**
  355. * @return mixed
  356. */
  357. public function getInsertUser()
  358. {
  359. return $this->insertUser;
  360. }
  361. /**
  362. * @param mixed $insertUser
  363. *
  364. * @return CarePost
  365. */
  366. public function setInsertUser($insertUser)
  367. {
  368. $this->insertUser = $insertUser;
  369. return $this;
  370. }
  371. }