LTI Integration Library 4.10.3
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
SubmissionReview.php
1<?php
2
3namespace ceLTIc\LTI;
4
13{
14
20 private $label = null;
21
27 private $endpoint = null;
28
34 private $custom = null;
35
43 public function __construct($label = null, $endpoint = null, $custom = null)
44 {
45 $this->label = $label;
46 $this->endpoint = $endpoint;
47 $this->custom = $custom;
48 }
49
57 public static function fromJsonObject($json)
58 {
59 if (!empty($json->label)) {
60 $label = $json->label;
61 } else {
62 $label = null;
63 }
64 if (!empty($json->url)) {
65 $endpoint = $json->url;
66 } else {
67 $endpoint = null;
68 }
69 if (!empty($json->custom)) {
70 $custom = $json->custom;
71 } else {
72 $custom = null;
73 }
74
75 return new SubmissionReview($label, $endpoint, $custom);
76 }
77
83 public function toJsonObject()
84 {
85 $obj = new \stdClass();
86 if (!empty($this->label)) {
87 $obj->label = $this->label;
88 }
89 if (!empty($this->endpoint)) {
90 $obj->url = $this->endpoint;
91 }
92 if (!empty($this->custom)) {
93 $obj->custom = $this->custom;
94 }
95
96 return $obj;
97 }
98
99}
Class to represent a submission review.
toJsonObject()
Generate the JSON object representation of the submission review.
__construct($label=null, $endpoint=null, $custom=null)
Class constructor.
static fromJsonObject($json)
Generate a SubmissionReview object from its JSON representation.