12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- //namespace Tasks;
- /**
- * @Entity @Table(name="tasks")
- */
- class Task extends BaseDBO
- {
- // public function __construct()
- // {
- // $this->accepted_time = new DateTime();
- // }
- /**
- * Many tasks have one project. This is the owning side.
- * @ManyToOne(targetEntity="Project", inversedBy="tasks")
- * @JoinColumn(name="input_id", referencedColumnName="id")
- */
- private $project;
- /** @Id @Column(type="integer") @GeneratedValue */
- protected $id;
- /** @Column(type="integer") */
- public $type;
- /** @Column(type="smallint") */
- public $priority;
- /** @Column(type="integer") */
- public $parent_id;
- /** @Column(type="smallint") */
- public $status;
- /** @Column(type="datetime") */
- public $created;
- /** @Column(type="datetime") */
- public $accepted_time;
- /** @Column(type="datetime") */
- public $finished_time;
- /** @Column(type="datetime") */
- public $expires;
- /** @Column(type="string") */
- public $text;
- /** @Column(type="smallint") */
- public $control_map_checked;
- /** @Column(type="string") */
- public $confirm_data;
- private $name;
- private $childrenTasks;
- //
- // function __construct(){}
- //
- // public static function CreateFromId($task_id)
- // {
- // global $link;
- // $query = mysqli_query($link, "select * from tasks where id = $task_id");
- //
- // if ($res = mysqli_fetch_array($query)) {
- // return CreateFromArray($res);
- // }
- // return null;
- // }
- //
- //
- //
- // public static function CreateFromArray($taskArr)
- // {
- // $task = new Task();
- // $task->id = $taskArr['id'];
- // $task->name = $taskArr['name'];
- // $task->priority = $taskArr['priority'];
- // $task->typeId = $taskArr['type'];
- // $task->parentTaskId = $taskArr['parent_id'];
- // $task->childrenTasks = array();
- //// $task->FillChildren();
- //// $task->SetName();
- // return $task;
- // }
- }
|