forked from JohanGriesel/Stratusolve-Exercise
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.class.php
More file actions
38 lines (37 loc) · 967 Bytes
/
Copy pathtask.class.php
File metadata and controls
38 lines (37 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* This class handles the modification of a task object
*/
class Task {
public $TaskId;
public $TaskName;
public $TaskDescription;
public function __construct($Id = null) {
if ($Id) {
// This is an existing task
$this->LoadFromId($Id);
} else {
// This is a new task
$this->Create();
}
}
protected function Create() {
// This function needs to generate a new unique ID for the task
// Assignment: Generate unique id for the new task
$this->TaskName = '';
$this->TaskDescription = '';
}
protected function LoadFromId($Id = null) {
if ($Id) {
// Assignment: Code to load details here...
} else
return null;
}
public function Save() {
//Assignment: Code to save task here
}
public function Delete() {
//Assignment: Code to delete task here
}
}
?>