ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
IMSGlobal\LTI\ToolProvider\ToolProxy Class Reference

Class to represent an LTI Tool Proxy. More...

+ Collaboration diagram for IMSGlobal\LTI\ToolProvider\ToolProxy:

Public Member Functions

 __construct ($dataConnector, $id=null)
 Class constructor. More...
 
 initialize ()
 Initialise the tool proxy. More...
 
 initialise ()
 Initialise the tool proxy. More...
 
 getRecordId ()
 Get the tool proxy record ID. More...
 
 setRecordId ($recordId)
 Sets the tool proxy record ID. More...
 
 getConsumer ()
 Get tool consumer. More...
 
 setConsumerId ($consumerId)
 Set tool consumer ID. More...
 
 getDataConnector ()
 Get the data connector. More...
 

Data Fields

 $id = null
 Local id of tool consumer. More...
 

Private Member Functions

 load ($id)
 Load the tool proxy from the database. More...
 

Private Attributes

 $consumer = null
 Tool Consumer for this tool proxy. More...
 
 $consumerId = null
 Tool Consumer ID for this tool proxy. More...
 
 $recordId = null
 
 $dataConnector = null
 Data connector object. More...
 
 $toolProxy = null
 Tool Proxy document. More...
 

Detailed Description

Class to represent an LTI Tool Proxy.

Author
Stephen P Vickers svick.nosp@m.ers@.nosp@m.imsgl.nosp@m.obal.nosp@m..org
Date
2016
Version
3.0.2 @license GNU Lesser General Public License, version 3 (http://www.gnu.org/licenses/lgpl.html)

Definition at line 17 of file ToolProxy.php.

Constructor & Destructor Documentation

◆ __construct()

IMSGlobal\LTI\ToolProvider\ToolProxy::__construct (   $dataConnector,
  $id = null 
)

Class constructor.

Parameters
DataConnector$dataConnectorData connector
string$idTool Proxy ID (optional, default is null)

Definition at line 64 of file ToolProxy.php.

65 {
66
67 $this->initialize();
68 $this->dataConnector = $dataConnector;
69 if (!empty($id)) {
70 $this->load($id);
71 } else {
72 $this->recordId = DataConnector::getRandomString(32);
73 }
74
75 }
static getRandomString($length=8)
Generate a random string.
if(!array_key_exists('StateId', $_REQUEST)) $id

References IMSGlobal\LTI\ToolProvider\ToolProxy\$dataConnector, $id, IMSGlobal\LTI\ToolProvider\DataConnector\DataConnector\getRandomString(), IMSGlobal\LTI\ToolProvider\ToolProxy\initialize(), and IMSGlobal\LTI\ToolProvider\ToolProxy\load().

+ Here is the call graph for this function:

Member Function Documentation

◆ getConsumer()

IMSGlobal\LTI\ToolProvider\ToolProxy::getConsumer ( )

Get tool consumer.

Returns
ToolConsumer Tool consumer object for this context.

Definition at line 132 of file ToolProxy.php.

133 {
134
135 if (is_null($this->consumer)) {
136 $this->consumer = ToolConsumer::fromRecordId($this->consumerId, $this->getDataConnector());
137 }
138
139 return $this->consumer;
140
141 }
static fromRecordId($id, $dataConnector)
Load the tool consumer from the database by its record ID.

References IMSGlobal\LTI\ToolProvider\ToolConsumer\fromRecordId(), and IMSGlobal\LTI\ToolProvider\ToolProxy\getDataConnector().

+ Here is the call graph for this function:

◆ getDataConnector()

IMSGlobal\LTI\ToolProvider\ToolProxy::getDataConnector ( )

Get the data connector.

Returns
DataConnector Data connector object

Definition at line 161 of file ToolProxy.php.

162 {
163
164 return $this->dataConnector;
165
166 }

Referenced by IMSGlobal\LTI\ToolProvider\ToolProxy\getConsumer().

+ Here is the caller graph for this function:

◆ getRecordId()

IMSGlobal\LTI\ToolProvider\ToolProxy::getRecordId ( )

Get the tool proxy record ID.

Returns
int Tool Proxy record ID value

Definition at line 108 of file ToolProxy.php.

109 {
110
111 return $this->recordId;
112
113 }

◆ initialise()

IMSGlobal\LTI\ToolProvider\ToolProxy::initialise ( )

Initialise the tool proxy.

Pseudonym for initialize().

Definition at line 96 of file ToolProxy.php.

97 {
98
99 $this->initialize();
100
101 }

References IMSGlobal\LTI\ToolProvider\ToolProxy\initialize().

+ Here is the call graph for this function:

◆ initialize()

IMSGlobal\LTI\ToolProvider\ToolProxy::initialize ( )

Initialise the tool proxy.

Definition at line 80 of file ToolProxy.php.

81 {
82
83 $this->id = null;
84 $this->recordId = null;
85 $this->toolProxy = null;
86 $this->created = null;
87 $this->updated = null;
88
89 }

Referenced by IMSGlobal\LTI\ToolProvider\ToolProxy\__construct(), IMSGlobal\LTI\ToolProvider\ToolProxy\initialise(), and IMSGlobal\LTI\ToolProvider\ToolProxy\load().

+ Here is the caller graph for this function:

◆ load()

IMSGlobal\LTI\ToolProvider\ToolProxy::load (   $id)
private

Load the tool proxy from the database.

Parameters
string$idThe tool proxy id value
Returns
boolean True if the tool proxy was successfully loaded

Definition at line 180 of file ToolProxy.php.

181 {
182
183 $this->initialize();
184 $this->id = $id;
185 $ok = $this->dataConnector->loadToolProxy($this);
186 if (!$ok) {
187 $this->enabled = $autoEnable;
188 }
189
190 return $ok;
191
192 }

References $id, $ok, and IMSGlobal\LTI\ToolProvider\ToolProxy\initialize().

Referenced by IMSGlobal\LTI\ToolProvider\ToolProxy\__construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setConsumerId()

IMSGlobal\LTI\ToolProvider\ToolProxy::setConsumerId (   $consumerId)

Set tool consumer ID.

Parameters
int$consumerIdTool Consumer ID for this resource link.

Definition at line 148 of file ToolProxy.php.

149 {
150
151 $this->consumer = null;
152 $this->consumerId = $consumerId;
153
154 }

References IMSGlobal\LTI\ToolProvider\ToolProxy\$consumerId.

◆ setRecordId()

IMSGlobal\LTI\ToolProvider\ToolProxy::setRecordId (   $recordId)

Sets the tool proxy record ID.

Parameters
int$recordIdTool Proxy record ID value

Definition at line 120 of file ToolProxy.php.

121 {
122
123 $this->recordId = $recordId;
124
125 }

References IMSGlobal\LTI\ToolProvider\ToolProxy\$recordId.

Field Documentation

◆ $consumer

ToolConsumer IMSGlobal\LTI\ToolProvider\ToolProxy::$consumer = null
private

Tool Consumer for this tool proxy.

Definition at line 32 of file ToolProxy.php.

◆ $consumerId

int IMSGlobal\LTI\ToolProvider\ToolProxy::$consumerId = null
private

Tool Consumer ID for this tool proxy.

Definition at line 38 of file ToolProxy.php.

Referenced by IMSGlobal\LTI\ToolProvider\ToolProxy\setConsumerId().

◆ $dataConnector

DataConnector IMSGlobal\LTI\ToolProvider\ToolProxy::$dataConnector = null
private

Data connector object.

Definition at line 50 of file ToolProxy.php.

Referenced by IMSGlobal\LTI\ToolProvider\ToolProxy\__construct().

◆ $id

int IMSGlobal\LTI\ToolProvider\ToolProxy::$id = null

Local id of tool consumer.

Consumer ID value.

Definition at line 25 of file ToolProxy.php.

◆ $recordId

IMSGlobal\LTI\ToolProvider\ToolProxy::$recordId = null
private

Definition at line 44 of file ToolProxy.php.

Referenced by IMSGlobal\LTI\ToolProvider\ToolProxy\setRecordId().

◆ $toolProxy

MediaType ToolProxy IMSGlobal\LTI\ToolProvider\ToolProxy::$toolProxy = null
private

Tool Proxy document.

Definition at line 56 of file ToolProxy.php.


The documentation for this class was generated from the following file: