-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathLTI_Lineitem.php
More file actions
108 lines (90 loc) · 2.65 KB
/
Copy pathLTI_Lineitem.php
File metadata and controls
108 lines (90 loc) · 2.65 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
namespace IMSGlobal\LTI;
class LTI_Lineitem {
private $id;
private $score_maximum;
private $label;
private $resource_id;
private $tag;
private $start_date_time;
private $end_date_time;
public function __construct(array $lineitem = null) {
if (empty($lineitem)) {
return;
}
$this->id = $lineitem["id"];
$this->score_maximum = $lineitem["scoreMaximum"];
$this->label = $lineitem["label"];
$this->resource_id = $lineitem["resourceId"];
$this->tag = $lineitem["tag"];
$this->start_date_time = $lineitem["startDateTime"] ?? null;
$this->end_date_time = $lineitem["endDateTime"] ?? null;
}
/**
* Static function to allow for method chaining without having to assign to a variable first.
*/
public static function new() {
return new LTI_Lineitem();
}
public function get_id() {
return $this->id;
}
public function set_id($value) {
$this->id = $value;
return $this;
}
public function get_label() {
return $this->label;
}
public function set_label($value) {
$this->label = $value;
return $this;
}
public function get_score_maximum() {
return $this->score_maximum;
}
public function set_score_maximum($value) {
$this->score_maximum = $value;
return $this;
}
public function get_resource_id() {
return $this->resource_id;
}
public function set_resource_id($value) {
$this->resource_id = $value;
return $this;
}
public function get_tag() {
return $this->tag;
}
public function set_tag($value) {
$this->tag = $value;
return $this;
}
public function get_start_date_time() {
return $this->start_date_time;
}
public function set_start_date_time($value) {
$this->start_date_time = $value;
return $this;
}
public function get_end_date_time() {
return $this->end_date_time;
}
public function set_end_date_time($value) {
$this->end_date_time = $value;
return $this;
}
public function __toString() {
return json_encode(array_filter([
"id" => $this->id,
"scoreMaximum" => $this->score_maximum,
"label" => $this->label,
"resourceId" => $this->resource_id,
"tag" => $this->tag,
"startDateTime" => $this->start_date_time,
"endDateTime" => $this->end_date_time,
]));
}
}
?>