From e9205a065c83bd50cef3dda4ee0dcb6f6dcc653e Mon Sep 17 00:00:00 2001 From: "nicolas.franco" Date: Wed, 7 Dec 2022 19:25:08 +0100 Subject: [PATCH] isDone and done counter added --- business/ListTask.php | 37 ++++++++++++++++++++++++++++++++++--- business/Task.php | 25 +++++++++++++++++-------- 2 files changed, 51 insertions(+), 11 deletions(-) diff --git a/business/ListTask.php b/business/ListTask.php index 6f77310..b43e6ae 100644 --- a/business/ListTask.php +++ b/business/ListTask.php @@ -2,11 +2,16 @@ class ListTask{ private int $id; private array $taches; + private string $nom; + private string $owner; + private int $dc; // done counter - function __construct($id, $taches) { + function __construct($id, $nom, $owner="") { $this->id = $id; - $this->taches = $taches; - } + $this->nom = $nom; + $this->taches = []; + $this->owner = $owner; + } function get_id() { return $this->id; @@ -23,5 +28,31 @@ function set_taches($taches) { $this->taches = $taches; } + + function get_nom() { + return $this->nom; + } + + function set_nom($nom) { + $this->nom= $nom; + } + + function get_owner() { + return $this->owner; + } + + function set_owner($owner) { + $this->owner = $owner; + } + + function get_dc() { + return $this->dc; + } + + function set_dc($dc) { + $this->dc = $dc; + } + + } ?> diff --git a/business/Task.php b/business/Task.php index bdc6ea1..c512bd3 100644 --- a/business/Task.php +++ b/business/Task.php @@ -7,6 +7,7 @@ private $dateFin; # $today = date("m.d.y") private string $priorite; private string $idlist; // # id associating task to list + private bool $isDone; // # si la tache est complete function __construct($id,$titre,$description,$priorite,$idl,$dateDeb="",$dateFin="") { $this->set_id($id); @@ -64,15 +65,23 @@ function set_priorite($priorite) { $this->priorite = $priorite; - } - // # getter et setter pour idList - function get_idList() { - return $this->idList; + } + // # getter et setter pour idList + function get_idList() { + return $this->idList; } - - function set_idList($idList) { - $this->idList = $idList; + + function set_idList($idList) { + $this->idList = $idList; + } + + function get_isDone() { + return $this->isDone; + } + + function set_isDone($isDone) { + $this->isDone = $isDone; } - + } ?>