LTI Integration Library 4.10.3
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
MediaType/Message.php
1<?php
2
3namespace ceLTIc\LTI\MediaType;
4
5use ceLTIc\LTI\Profile;
6
15{
16
22 public $message_type = null;
23
29 public $path = null;
30
36 public $enabled_capability = null;
37
43 public $parameter = null;
44
51 function __construct($message, $capabilitiesOffered)
52 {
53 $this->message_type = $message->type;
54 $this->path = $message->path;
55 $this->enabled_capability = array();
56 foreach ($message->capabilities as $capability) {
57 if (in_array($capability, $capabilitiesOffered)) {
58 $this->enabled_capability[] = $capability;
59 }
60 }
61 $this->parameter = array();
62 foreach ($message->constants as $name => $value) {
63 $parameter = new \stdClass;
64 $parameter->name = $name;
65 $parameter->fixed = $value;
66 $this->parameter[] = $parameter;
67 }
68 foreach ($message->variables as $name => $value) {
69 if (in_array($value, $capabilitiesOffered)) {
70 $parameter = new \stdClass;
71 $parameter->name = $name;
72 $parameter->variable = $value;
73 $this->parameter[] = $parameter;
74 }
75 }
76 }
77
78}
Class to represent an LTI Message.
$enabled_capability
Enabled capabilities.
__construct($message, $capabilitiesOffered)
Class constructor.
$path
Path to send message request to (used in conjunction with a base URL for the Tool).