Task.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. //namespace Tasks;
  3. /**
  4. * @Entity @Table(name="tasks")
  5. */
  6. class Task extends BaseDBO
  7. {
  8. // public function __construct()
  9. // {
  10. // $this->accepted_time = new DateTime();
  11. // }
  12. /**
  13. * Many tasks have one project. This is the owning side.
  14. * @ManyToOne(targetEntity="Project", inversedBy="tasks")
  15. * @JoinColumn(name="input_id", referencedColumnName="id")
  16. */
  17. private $project;
  18. /** @Id @Column(type="integer") @GeneratedValue */
  19. protected $id;
  20. /** @Column(type="integer") */
  21. public $type;
  22. /** @Column(type="smallint") */
  23. public $priority;
  24. /** @Column(type="integer") */
  25. public $parent_id;
  26. /** @Column(type="smallint") */
  27. public $status;
  28. /** @Column(type="datetime") */
  29. public $created;
  30. /** @Column(type="datetime") */
  31. public $accepted_time;
  32. /** @Column(type="datetime") */
  33. public $finished_time;
  34. /** @Column(type="datetime") */
  35. public $expires;
  36. /** @Column(type="string") */
  37. public $text;
  38. /** @Column(type="smallint") */
  39. public $control_map_checked;
  40. /** @Column(type="string") */
  41. public $confirm_data;
  42. private $name;
  43. private $childrenTasks;
  44. //
  45. // function __construct(){}
  46. //
  47. // public static function CreateFromId($task_id)
  48. // {
  49. // global $link;
  50. // $query = mysqli_query($link, "select * from tasks where id = $task_id");
  51. //
  52. // if ($res = mysqli_fetch_array($query)) {
  53. // return CreateFromArray($res);
  54. // }
  55. // return null;
  56. // }
  57. //
  58. //
  59. //
  60. // public static function CreateFromArray($taskArr)
  61. // {
  62. // $task = new Task();
  63. // $task->id = $taskArr['id'];
  64. // $task->name = $taskArr['name'];
  65. // $task->priority = $taskArr['priority'];
  66. // $task->typeId = $taskArr['type'];
  67. // $task->parentTaskId = $taskArr['parent_id'];
  68. // $task->childrenTasks = array();
  69. //// $task->FillChildren();
  70. //// $task->SetName();
  71. // return $task;
  72. // }
  73. }