CarePost.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. namespace Chamilo\PluginBundle\Entity\StudentFollowUp;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. use Doctrine\ORM\Mapping as ORM;
  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 integer
  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\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", cascade={"persist"})
  43. * @ORM\JoinColumn(name="insert_user_id", referencedColumnName="id", nullable=false)
  44. */
  45. private $insertUser;
  46. /**
  47. * @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", cascade={"persist"})
  48. * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
  49. */
  50. private $user;
  51. /**
  52. * @ORM\Column(name="created_at", type="datetime", nullable=true)
  53. */
  54. protected $createdAt;
  55. /**
  56. * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  57. */
  58. protected $updatedAt;
  59. /**
  60. * @var bool
  61. *
  62. * @ORM\Column(name="private", type="boolean")
  63. */
  64. protected $private;
  65. /**
  66. * @var bool
  67. *
  68. * @ORM\Column(name="external_source", type="boolean")
  69. */
  70. protected $externalSource;
  71. /**
  72. * @var array
  73. *
  74. * @ORM\Column(name="tags", type="array")
  75. */
  76. protected $tags;
  77. /**
  78. * @var string
  79. *
  80. * @ORM\Column(name="attachment", type="string", length=255)
  81. */
  82. protected $attachment;
  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 integer
  96. * @Gedmo\TreeLeft
  97. * @ORM\Column(name="lft", type="integer", nullable=true, unique=false)
  98. */
  99. private $lft;
  100. /**
  101. * @var integer
  102. * @Gedmo\TreeRight
  103. * @ORM\Column(name="rgt", type="integer", nullable=true, unique=false)
  104. */
  105. private $rgt;
  106. /**
  107. * @var integer
  108. * @Gedmo\TreeLevel
  109. * @ORM\Column(name="lvl", type="integer", nullable=true, unique=false)
  110. */
  111. private $lvl;
  112. /**
  113. * @var integer
  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. * @return $this
  136. */
  137. public function setId($id)
  138. {
  139. $this->id = $id;
  140. return $this;
  141. }
  142. /**
  143. * @return string
  144. */
  145. public function getTitle()
  146. {
  147. return $this->title;
  148. }
  149. /**
  150. * @param string $title
  151. * @return CarePost
  152. */
  153. public function setTitle($title)
  154. {
  155. $this->title = $title;
  156. return $this;
  157. }
  158. /**
  159. * @return string
  160. */
  161. public function getContent()
  162. {
  163. return $this->content;
  164. }
  165. /**
  166. * @param string $content
  167. * @return CarePost
  168. */
  169. public function setContent($content)
  170. {
  171. $this->content = $content;
  172. return $this;
  173. }
  174. /**
  175. * @return string
  176. */
  177. public function getExternalCareId()
  178. {
  179. return $this->externalCareId;
  180. }
  181. /**
  182. * @param string $externalCareId
  183. * @return CarePost
  184. */
  185. public function setExternalCareId($externalCareId)
  186. {
  187. $this->externalCareId = $externalCareId;
  188. return $this;
  189. }
  190. /**
  191. * @return mixed
  192. */
  193. public function getUser()
  194. {
  195. return $this->user;
  196. }
  197. /**
  198. * @param mixed $user
  199. * @return CarePost
  200. */
  201. public function setUser($user)
  202. {
  203. $this->user = $user;
  204. return $this;
  205. }
  206. /**
  207. * @return bool
  208. */
  209. public function isPrivate()
  210. {
  211. return $this->private;
  212. }
  213. /**
  214. * @param bool $private
  215. * @return CarePost
  216. */
  217. public function setPrivate($private)
  218. {
  219. $this->private = $private;
  220. return $this;
  221. }
  222. /**
  223. * @return bool
  224. */
  225. public function isExternalSource()
  226. {
  227. return $this->externalSource;
  228. }
  229. /**
  230. * @param bool $externalSource
  231. * @return CarePost
  232. */
  233. public function setExternalSource($externalSource)
  234. {
  235. $this->externalSource = $externalSource;
  236. return $this;
  237. }
  238. /**
  239. * @return string
  240. */
  241. public function getAttachment()
  242. {
  243. return $this->attachment;
  244. }
  245. /**
  246. * @param string $attachment
  247. * @return CarePost
  248. */
  249. public function setAttachment($attachment)
  250. {
  251. $this->attachment = $attachment;
  252. return $this;
  253. }
  254. /**
  255. * @return mixed
  256. */
  257. public function getParent()
  258. {
  259. return $this->parent;
  260. }
  261. /**
  262. * @param mixed $parent
  263. * @return CarePost
  264. */
  265. public function setParent($parent)
  266. {
  267. $this->parent = $parent;
  268. return $this;
  269. }
  270. /**
  271. * @return int
  272. */
  273. public function hasParent()
  274. {
  275. return !empty($this->parent) ? 1 : 0;
  276. }
  277. /**
  278. * @return mixed
  279. */
  280. public function getChildren()
  281. {
  282. return $this->children;
  283. }
  284. /**
  285. * @param mixed $children
  286. * @return CarePost
  287. */
  288. public function setChildren($children)
  289. {
  290. $this->children = $children;
  291. return $this;
  292. }
  293. /**
  294. * @return mixed
  295. */
  296. public function getCreatedAt()
  297. {
  298. return $this->createdAt;
  299. }
  300. /**
  301. * @param mixed $createdAt
  302. * @return CarePost
  303. */
  304. public function setCreatedAt($createdAt)
  305. {
  306. $this->createdAt = $createdAt;
  307. return $this;
  308. }
  309. /**
  310. * @return mixed
  311. */
  312. public function getUpdatedAt()
  313. {
  314. return $this->updatedAt;
  315. }
  316. /**
  317. * @param mixed $updatedAt
  318. * @return CarePost
  319. */
  320. public function setUpdatedAt($updatedAt)
  321. {
  322. $this->updatedAt = $updatedAt;
  323. return $this;
  324. }
  325. /**
  326. * @return array
  327. */
  328. public function getTags()
  329. {
  330. return $this->tags;
  331. }
  332. /**
  333. * @param array $tags
  334. * @return CarePost
  335. */
  336. public function setTags($tags)
  337. {
  338. $this->tags = $tags;
  339. return $this;
  340. }
  341. /**
  342. * @return mixed
  343. */
  344. public function getInsertUser()
  345. {
  346. return $this->insertUser;
  347. }
  348. /**
  349. * @param mixed $insertUser
  350. * @return CarePost
  351. */
  352. public function setInsertUser($insertUser)
  353. {
  354. $this->insertUser = $insertUser;
  355. return $this;
  356. }
  357. }