CItemProperty.php 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. <?php
  2. namespace Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * CItemProperty
  6. *
  7. * @ORM\Table(name="c_item_property")
  8. * @ORM\Entity(repositoryClass="Entity\Repository\ItemPropertyRepository")
  9. */
  10. class CItemProperty
  11. {
  12. /**
  13. * @var integer
  14. *
  15. * @ORM\Column(name="c_id", type="integer", precision=0, scale=0, nullable=false, unique=false)
  16. */
  17. private $cId;
  18. /**
  19. * @var integer
  20. *
  21. * @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
  22. * @ORM\Id
  23. * @ORM\GeneratedValue(strategy="IDENTITY")
  24. */
  25. private $id;
  26. /**
  27. * @var string
  28. *
  29. * @ORM\Column(name="tool", type="string", length=100, precision=0, scale=0, nullable=false, unique=false)
  30. */
  31. private $tool;
  32. /**
  33. * @var integer
  34. *
  35. * @ORM\Column(name="insert_user_id", type="integer", precision=0, scale=0, nullable=false, unique=false)
  36. */
  37. private $insertUserId;
  38. /**
  39. * @var \DateTime
  40. *
  41. * @ORM\Column(name="insert_date", type="datetime", precision=0, scale=0, nullable=false, unique=false)
  42. */
  43. private $insertDate;
  44. /**
  45. * @var \DateTime
  46. *
  47. * @ORM\Column(name="lastedit_date", type="datetime", precision=0, scale=0, nullable=false, unique=false)
  48. */
  49. private $lasteditDate;
  50. /**
  51. * @var integer
  52. *
  53. * @ORM\Column(name="ref", type="integer", precision=0, scale=0, nullable=false, unique=false)
  54. */
  55. private $ref;
  56. /**
  57. * @var string
  58. *
  59. * @ORM\Column(name="lastedit_type", type="string", length=100, precision=0, scale=0, nullable=false, unique=false)
  60. */
  61. private $lasteditType;
  62. /**
  63. * @var integer
  64. *
  65. * @ORM\Column(name="lastedit_user_id", type="integer", precision=0, scale=0, nullable=false, unique=false)
  66. */
  67. private $lasteditUserId;
  68. /**
  69. * @var integer
  70. *
  71. * @ORM\Column(name="to_group_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
  72. */
  73. private $toGroupId;
  74. /**
  75. * @var integer
  76. *
  77. * @ORM\Column(name="to_user_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
  78. */
  79. private $toUserId;
  80. /**
  81. * @var boolean
  82. *
  83. * @ORM\Column(name="visibility", type="boolean", precision=0, scale=0, nullable=false, unique=false)
  84. */
  85. private $visibility;
  86. /**
  87. * @var \DateTime
  88. *
  89. * @ORM\Column(name="start_visible", type="datetime", precision=0, scale=0, nullable=true, unique=false)
  90. */
  91. private $startVisible;
  92. /**
  93. * @var \DateTime
  94. *
  95. * @ORM\Column(name="end_visible", type="datetime", precision=0, scale=0, nullable=true, unique=false)
  96. */
  97. private $endVisible;
  98. /**
  99. * @var integer
  100. *
  101. * @ORM\Column(name="id_session", type="integer", precision=0, scale=0, nullable=false, unique=false)
  102. */
  103. private $idSession;
  104. /* Adding many to many relationships */
  105. /**
  106. *
  107. * @ORM\ManyToOne(targetEntity="User")
  108. * @ORM\JoinColumn(name="to_user_id", referencedColumnName="user_id")
  109. **/
  110. private $user;
  111. /**
  112. * @ORM\ManyToOne(targetEntity="Course")
  113. * @ORM\JoinColumn(name="c_id", referencedColumnName="id")
  114. */
  115. private $course;
  116. /**
  117. * @ORM\ManyToOne(targetEntity="CGroupInfo")
  118. * @ORM\JoinColumn(name="to_group_id", referencedColumnName="iid")
  119. */
  120. private $group;
  121. /**
  122. * @ORM\ManyToOne(targetEntity="Session")
  123. * @ORM\JoinColumn(name="id_session", referencedColumnName="id", nullable=true)
  124. */
  125. private $session;
  126. /**
  127. * @param Course $course
  128. */
  129. public function __construct(Course $course)
  130. {
  131. //Mandatory
  132. $this->course = $course;
  133. $this->setInsertUserId(api_get_user_id());
  134. $this->setLasteditUserId(api_get_user_id());
  135. $this->setInsertDate(new \DateTime());
  136. $this->setLasteditDate(new \DateTime());
  137. }
  138. /**
  139. * @param User $user
  140. */
  141. public function setUser(User $user)
  142. {
  143. $this->user = $user;
  144. }
  145. /**
  146. * @param Course $course
  147. */
  148. public function setCourse(Course $course)
  149. {
  150. $this->course = $course;
  151. }
  152. /**
  153. * @param CGroupInfo $group
  154. */
  155. public function setGroup(CGroupInfo $group)
  156. {
  157. $this->group = $group;
  158. }
  159. /**
  160. * @param Session $session
  161. */
  162. public function setSession(Session $session)
  163. {
  164. $this->session = $session;
  165. }
  166. /**
  167. * Set cId
  168. *
  169. * @param integer $cId
  170. *
  171. * @return CItemProperty
  172. */
  173. public function setCId($cId)
  174. {
  175. $this->cId = $cId;
  176. return $this;
  177. }
  178. /**
  179. * Get cId
  180. *
  181. * @return integer
  182. */
  183. public function getCId()
  184. {
  185. return $this->cId;
  186. }
  187. /**
  188. * Set id
  189. *
  190. * @param integer $id
  191. *
  192. * @return CItemProperty
  193. */
  194. public function setId($id)
  195. {
  196. $this->id = $id;
  197. return $this;
  198. }
  199. /**
  200. * Get id
  201. *
  202. * @return integer
  203. */
  204. public function getId()
  205. {
  206. return $this->id;
  207. }
  208. /**
  209. * Set tool
  210. *
  211. * @param string $tool
  212. *
  213. * @return CItemProperty
  214. */
  215. public function setTool($tool)
  216. {
  217. $this->tool = $tool;
  218. return $this;
  219. }
  220. /**
  221. * Get tool
  222. *
  223. * @return string
  224. */
  225. public function getTool()
  226. {
  227. return $this->tool;
  228. }
  229. /**
  230. * Set insertUserId
  231. *
  232. * @param integer $insertUserId
  233. *
  234. * @return CItemProperty
  235. */
  236. public function setInsertUserId($insertUserId)
  237. {
  238. $this->insertUserId = $insertUserId;
  239. return $this;
  240. }
  241. /**
  242. * Get insertUserId
  243. *
  244. * @return integer
  245. */
  246. public function getInsertUserId()
  247. {
  248. return $this->insertUserId;
  249. }
  250. /**
  251. * Set insertDate
  252. *
  253. * @param \DateTime $insertDate
  254. *
  255. * @return CItemProperty
  256. */
  257. public function setInsertDate($insertDate)
  258. {
  259. $this->insertDate = $insertDate;
  260. return $this;
  261. }
  262. /**
  263. * Get insertDate
  264. *
  265. * @return \DateTime
  266. */
  267. public function getInsertDate()
  268. {
  269. return $this->insertDate;
  270. }
  271. /**
  272. * Set lasteditDate
  273. *
  274. * @param \DateTime $lasteditDate
  275. *
  276. * @return CItemProperty
  277. */
  278. public function setLasteditDate($lasteditDate)
  279. {
  280. $this->lasteditDate = $lasteditDate;
  281. return $this;
  282. }
  283. /**
  284. * Get lasteditDate
  285. *
  286. * @return \DateTime
  287. */
  288. public function getLasteditDate()
  289. {
  290. return $this->lasteditDate;
  291. }
  292. /**
  293. * Set ref
  294. *
  295. * @param integer $ref
  296. *
  297. * @return CItemProperty
  298. */
  299. public function setRef($ref)
  300. {
  301. $this->ref = $ref;
  302. return $this;
  303. }
  304. /**
  305. * Get ref
  306. *
  307. * @return integer
  308. */
  309. public function getRef()
  310. {
  311. return $this->ref;
  312. }
  313. /**
  314. * Set lasteditType
  315. *
  316. * @param string $lasteditType
  317. *
  318. * @return CItemProperty
  319. */
  320. public function setLasteditType($lasteditType)
  321. {
  322. $this->lasteditType = $lasteditType;
  323. return $this;
  324. }
  325. /**
  326. * Get lasteditType
  327. *
  328. * @return string
  329. */
  330. public function getLasteditType()
  331. {
  332. return $this->lasteditType;
  333. }
  334. /**
  335. * Set lasteditUserId
  336. *
  337. * @param integer $lasteditUserId
  338. *
  339. * @return CItemProperty
  340. */
  341. public function setLasteditUserId($lasteditUserId)
  342. {
  343. $this->lasteditUserId = $lasteditUserId;
  344. return $this;
  345. }
  346. /**
  347. * Get lasteditUserId
  348. *
  349. * @return integer
  350. */
  351. public function getLasteditUserId()
  352. {
  353. return $this->lasteditUserId;
  354. }
  355. /**
  356. * Set toGroupId
  357. *
  358. * @param integer $toGroupId
  359. *
  360. * @return CItemProperty
  361. */
  362. public function setToGroupId($toGroupId)
  363. {
  364. $this->toGroupId = $toGroupId;
  365. return $this;
  366. }
  367. /**
  368. * Get toGroupId
  369. *
  370. * @return integer
  371. */
  372. public function getToGroupId()
  373. {
  374. return $this->toGroupId;
  375. }
  376. /**
  377. * Set toUserId
  378. *
  379. * @param integer $toUserId
  380. *
  381. * @return CItemProperty
  382. */
  383. public function setToUserId($toUserId)
  384. {
  385. $this->toUserId = $toUserId;
  386. return $this;
  387. }
  388. /**
  389. * Get toUserId
  390. *
  391. * @return integer
  392. */
  393. public function getToUserId()
  394. {
  395. return $this->toUserId;
  396. }
  397. /**
  398. * Set visibility
  399. *
  400. * @param boolean $visibility
  401. *
  402. * @return CItemProperty
  403. */
  404. public function setVisibility($visibility)
  405. {
  406. $this->visibility = $visibility;
  407. return $this;
  408. }
  409. /**
  410. * Get visibility
  411. *
  412. * @return boolean
  413. */
  414. public function getVisibility()
  415. {
  416. return $this->visibility;
  417. }
  418. /**
  419. * Set startVisible
  420. *
  421. * @param \DateTime $startVisible
  422. *
  423. * @return CItemProperty
  424. */
  425. public function setStartVisible($startVisible)
  426. {
  427. $this->startVisible = $startVisible;
  428. return $this;
  429. }
  430. /**
  431. * Get startVisible
  432. *
  433. * @return \DateTime
  434. */
  435. public function getStartVisible()
  436. {
  437. return $this->startVisible;
  438. }
  439. /**
  440. * Set endVisible
  441. *
  442. * @param \DateTime $endVisible
  443. *
  444. * @return CItemProperty
  445. */
  446. public function setEndVisible($endVisible)
  447. {
  448. $this->endVisible = $endVisible;
  449. return $this;
  450. }
  451. /**
  452. * Get endVisible
  453. *
  454. * @return \DateTime
  455. */
  456. public function getEndVisible()
  457. {
  458. return $this->endVisible;
  459. }
  460. /**
  461. * Set idSession
  462. *
  463. * @param integer $idSession
  464. *
  465. * @return CItemProperty
  466. */
  467. public function setIdSession($idSession)
  468. {
  469. $this->idSession = $idSession;
  470. return $this;
  471. }
  472. /**
  473. * Get idSession
  474. *
  475. * @return integer
  476. */
  477. public function getIdSession()
  478. {
  479. return $this->idSession;
  480. }
  481. }