ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilLTIToolConsumer Class Reference

LTI provider for LTI launch. More...

+ Inheritance diagram for ilLTIToolConsumer:
+ Collaboration diagram for ilLTIToolConsumer:

Public Member Functions

 setExtConsumerId ($a_id)
 
 getExtConsumerId ()
 
 setRefId ($a_ref_id)
 
 getRefId ()
 
 getId ()
 
 setTitle ($title)
 
 getTitle ()
 
 setDescription ($description)
 
 getDescription ()
 
 setPrefix ($prefix)
 
 getPrefix ()
 
 setSecret ($secret)
 
 getSecret ()
 
 createSecret ()
 Create a secret. More...
 
 setLanguage ($lang)
 
 getLanguage ()
 
 setActive ($value)
 
 getActive ()
 
 setRole ($role_id)
 
 getRole ()
 
 setEnabled ($a_status)
 
 getEnabled ()
 
 saveGlobalToolConsumerSettings (ilLTIDataConnector $dataConnector)
 Save global consumer settings. More...
 
 deleteGlobalToolConsumerSettings (ilLTIDataConnector $dataConnector)
 Delete global tool consumer settings. More...
 
 saveLTI ($dataConnector)
 Save the tool consumer to the database with ILIAS extension. More...
 

Static Public Member Functions

static fromRecordId ($id, $dataConnector)
 Load the tool consumer from the database by its record ID. More...
 
static fromExternalConsumerId ($id, $dataConnector)
 
static fromGlobalSettingsAndRefId ($a_ext_consumer_id, $a_ref_id, ilLTIDataConnector $a_data_connector)
 Load consumer from global settings and ref_id. More...
 

Protected Attributes

 $ref_id
 
 $ext_consumer_id = 0
 
 $title = ''
 
 $description = ''
 
 $prefix = ''
 
 $user_language = ''
 
 $role = 0
 

Detailed Description

LTI provider for LTI launch.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 13 of file class.ilLTIToolConsumer.php.

Member Function Documentation

◆ createSecret()

ilLTIToolConsumer::createSecret ( )

Create a secret.

Definition at line 149 of file class.ilLTIToolConsumer.php.

150 {
151 $this->setSecret(\IMSGlobal\LTI\ToolProvider\DataConnector\DataConnector::getRandomString(12));
152 }

References setSecret().

+ Here is the call graph for this function:

◆ deleteGlobalToolConsumerSettings()

ilLTIToolConsumer::deleteGlobalToolConsumerSettings ( ilLTIDataConnector  $dataConnector)

Delete global tool consumer settings.

Parameters
ilLTIDataConnector$dataConnector

Definition at line 292 of file class.ilLTIToolConsumer.php.

293 {
294 $dataConnector->deleteGlobalToolConsumerSettings($this);
295 }
deleteGlobalToolConsumerSettings(ilLTIToolConsumer $consumer)
Delete global tool consumer settings.

References ilLTIDataConnector\deleteGlobalToolConsumerSettings().

+ Here is the call graph for this function:

◆ fromExternalConsumerId()

static ilLTIToolConsumer::fromExternalConsumerId (   $id,
  $dataConnector 
)
static
Parameters
type$id
type$dataConnector

Definition at line 244 of file class.ilLTIToolConsumer.php.

245 {
246 $toolConsumer = new ilLTIToolConsumer(null, $dataConnector);
247 $toolConsumer->initialize();
248 $toolConsumer->setExtConsumerId($id);
249 if (!$dataConnector->loadGlobalToolConsumerSettings($toolConsumer)) {
250 $toolConsumer->initialize();
251 }
252 return $toolConsumer;
253 }
LTI provider for LTI launch.

Referenced by ilObjLTIAdministrationGUI\changeStatusLTIConsumer(), ilObjLTIAdministrationGUI\deleteLTIConsumer(), ilObjLTIAdministrationGUI\editConsumer(), and ilObjLTIAdministrationGUI\updateLTIConsumer().

+ Here is the caller graph for this function:

◆ fromGlobalSettingsAndRefId()

static ilLTIToolConsumer::fromGlobalSettingsAndRefId (   $a_ext_consumer_id,
  $a_ref_id,
ilLTIDataConnector  $a_data_connector 
)
static

Load consumer from global settings and ref_id.

Parameters
type$a_ext_consumer_id
type$a_ref_id
ilLTIDataConnector$a_data_connector@retrun ilLTIToolConsumer

Definition at line 263 of file class.ilLTIToolConsumer.php.

264 {
265 $toolConsumer = new ilLTIToolConsumer(null, $a_data_connector);
266 $toolConsumer->initialize();
267 $toolConsumer->setExtConsumerId($a_ext_consumer_id);
268 $toolConsumer->setRefId($a_ref_id);
269
270 $consumer_pk = $a_data_connector->lookupRecordIdByGlobalSettingsAndRefId($toolConsumer);
271 if ($consumer_pk) {
272 return self::fromRecordId($consumer_pk, $a_data_connector);
273 }
274 $toolConsumer->initialize();
275 return $toolConsumer;
276 }
lookupRecordIdByGlobalSettingsAndRefId(ilLTIToolConsumer $consumer)
Lookup record id for global settings and ref_id.
static fromRecordId($id, $dataConnector)
Load the tool consumer from the database by its record ID.

References fromRecordId(), and ilLTIDataConnector\lookupRecordIdByGlobalSettingsAndRefId().

Referenced by ilLTIProviderObjectSettingGUI\initObjectSettingsForm(), and ilLTIProviderObjectSettingGUI\updateSettings().

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

◆ fromRecordId()

static ilLTIToolConsumer::fromRecordId (   $id,
  $dataConnector 
)
static

Load the tool consumer from the database by its record ID.

Parameters
int$idThe consumer key record ID
DataConnector$dataConnectorDatabase connection object
Returns
object ToolConsumer The tool consumer object

Definition at line 223 of file class.ilLTIToolConsumer.php.

224 {
225 $toolConsumer = new ilLTIToolConsumer(null, $dataConnector);
226
227 $toolConsumer->initialize();
228 $toolConsumer->setRecordId($id);
229 if (!$dataConnector->loadToolConsumerILIAS($toolConsumer)) {
230 $toolConsumer->initialize();
231 }
232 $toolConsumer->setRecordId($id);
233
234 ilLoggerFactory::getLogger('lti')->info('Loading with record id: ' . $toolConsumer->getRecordId());
235
236 return $toolConsumer;
237 }
static getLogger($a_component_id)
Get component logger.

References ilLoggerFactory\getLogger().

Referenced by fromGlobalSettingsAndRefId(), and ilAuthProviderLTI\lookupConsumer().

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

◆ getActive()

ilLTIToolConsumer::getActive ( )
Returns
integer

Definition at line 181 of file class.ilLTIToolConsumer.php.

182 {
183 return $this->active;
184 }

Referenced by ilLTIDataConnector\saveGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ getDescription()

ilLTIToolConsumer::getDescription ( )
Returns
string

Definition at line 108 of file class.ilLTIToolConsumer.php.

References $description.

Referenced by ilLTIDataConnector\saveGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ getEnabled()

ilLTIToolConsumer::getEnabled ( )

Definition at line 208 of file class.ilLTIToolConsumer.php.

209 {
210 return $this->enabled;
211 }

◆ getExtConsumerId()

◆ getId()

ilLTIToolConsumer::getId ( )
Returns
integer

Definition at line 75 of file class.ilLTIToolConsumer.php.

76 {
77 return $this->getRecordId();
78 }

◆ getLanguage()

ilLTIToolConsumer::getLanguage ( )
Returns
string

Definition at line 165 of file class.ilLTIToolConsumer.php.

References $user_language.

Referenced by ilAuthProviderLTI\createUser(), and ilLTIDataConnector\saveGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ getPrefix()

ilLTIToolConsumer::getPrefix ( )
Returns
string

Definition at line 124 of file class.ilLTIToolConsumer.php.

125 {
126 return $this->prefix;
127 }

References $prefix.

Referenced by ilAuthProviderLTI\createUser(), and ilLTIDataConnector\saveGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ getRefId()

ilLTIToolConsumer::getRefId ( )

Definition at line 67 of file class.ilLTIToolConsumer.php.

References $ref_id.

Referenced by ilLTIDataConnector\lookupRecordIdByGlobalSettingsAndRefId(), and ilLTIDataConnector\saveToolConsumerILIAS().

+ Here is the caller graph for this function:

◆ getRole()

ilLTIToolConsumer::getRole ( )
Returns
integer

Definition at line 197 of file class.ilLTIToolConsumer.php.

198 {
199 return $this->role;
200 }

References $role.

Referenced by ilAuthProviderLTI\createUser(), ilLTIDataConnector\saveGlobalToolConsumerSettings(), and ilAuthProviderLTI\updateUser().

+ Here is the caller graph for this function:

◆ getSecret()

ilLTIToolConsumer::getSecret ( )
Returns
string

Definition at line 140 of file class.ilLTIToolConsumer.php.

141 {
142 return $this->secret;
143 }

◆ getTitle()

ilLTIToolConsumer::getTitle ( )
Returns
string

Definition at line 92 of file class.ilLTIToolConsumer.php.

References $title.

Referenced by ilLTIDataConnector\saveGlobalToolConsumerSettings(), and ilLTIDataConnector\saveToolConsumerILIAS().

+ Here is the caller graph for this function:

◆ saveGlobalToolConsumerSettings()

ilLTIToolConsumer::saveGlobalToolConsumerSettings ( ilLTIDataConnector  $dataConnector)

Save global consumer settings.

Parameters
ilLTIDataConnector$dataConnector

Definition at line 283 of file class.ilLTIToolConsumer.php.

284 {
285 $dataConnector->saveGlobalToolConsumerSettings($this);
286 }
saveGlobalToolConsumerSettings(ilLTIToolConsumer $consumer)
Save lti_ext_consumer @global type $DIC.

References ilLTIDataConnector\saveGlobalToolConsumerSettings().

+ Here is the call graph for this function:

◆ saveLTI()

ilLTIToolConsumer::saveLTI (   $dataConnector)

Save the tool consumer to the database with ILIAS extension.

Returns
boolean True if the object was successfully saved

Definition at line 303 of file class.ilLTIToolConsumer.php.

304 {
305 $ok = $dataConnector->saveToolConsumerILIAS($this);
306 return $ok;
307 }

References $ok.

◆ setActive()

ilLTIToolConsumer::setActive (   $value)
Parameters
integer$value

Definition at line 173 of file class.ilLTIToolConsumer.php.

174 {
175 $this->active = $value;
176 }

Referenced by ilLTIDataConnector\loadGlobalToolConsumerSettings(), and ilLTIDataConnector\loadObjectToolConsumerSettings().

+ Here is the caller graph for this function:

◆ setDescription()

ilLTIToolConsumer::setDescription (   $description)
Parameters
string$description

Definition at line 100 of file class.ilLTIToolConsumer.php.

101 {
102 $this->description = $description;
103 }

References $description.

Referenced by ilLTIDataConnector\loadGlobalToolConsumerSettings(), and ilLTIDataConnector\loadObjectToolConsumerSettings().

+ Here is the caller graph for this function:

◆ setEnabled()

ilLTIToolConsumer::setEnabled (   $a_status)

Definition at line 203 of file class.ilLTIToolConsumer.php.

204 {
205 $this->enabled = $a_status;
206 }

◆ setExtConsumerId()

ilLTIToolConsumer::setExtConsumerId (   $a_id)

Definition at line 52 of file class.ilLTIToolConsumer.php.

53 {
54 $this->ext_consumer_id = $a_id;
55 }

Referenced by ilLTIDataConnector\loadToolConsumerILIAS(), and ilLTIDataConnector\saveGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ setLanguage()

ilLTIToolConsumer::setLanguage (   $lang)
Parameters
string$lang(int?)

Definition at line 157 of file class.ilLTIToolConsumer.php.

158 {
159 $this->user_language = $lang;
160 }
$lang
Definition: xapiexit.php:8

References $lang.

Referenced by ilLTIDataConnector\loadGlobalToolConsumerSettings(), and ilLTIDataConnector\loadObjectToolConsumerSettings().

+ Here is the caller graph for this function:

◆ setPrefix()

ilLTIToolConsumer::setPrefix (   $prefix)
Parameters
string$prefix

Definition at line 116 of file class.ilLTIToolConsumer.php.

117 {
118 $this->prefix = $prefix;
119 }

References $prefix.

Referenced by ilLTIDataConnector\loadGlobalToolConsumerSettings(), and ilLTIDataConnector\loadObjectToolConsumerSettings().

+ Here is the caller graph for this function:

◆ setRefId()

ilLTIToolConsumer::setRefId (   $a_ref_id)

Definition at line 62 of file class.ilLTIToolConsumer.php.

63 {
64 $this->ref_id = $a_ref_id;
65 }

Referenced by ilLTIDataConnector\loadToolConsumerILIAS().

+ Here is the caller graph for this function:

◆ setRole()

ilLTIToolConsumer::setRole (   $role_id)
Parameters
integer$role_id

Definition at line 189 of file class.ilLTIToolConsumer.php.

190 {
191 $this->role = $role_id;
192 }

Referenced by ilLTIDataConnector\loadGlobalToolConsumerSettings(), and ilLTIDataConnector\loadObjectToolConsumerSettings().

+ Here is the caller graph for this function:

◆ setSecret()

ilLTIToolConsumer::setSecret (   $secret)
Parameters
string$secret

Definition at line 132 of file class.ilLTIToolConsumer.php.

133 {
134 $this->secret = $secret;
135 }

Referenced by createSecret().

+ Here is the caller graph for this function:

◆ setTitle()

ilLTIToolConsumer::setTitle (   $title)
Parameters
string$title

Definition at line 83 of file class.ilLTIToolConsumer.php.

84 {
85 $this->title = $title;
86 // $this->consumerName = $title;
87 }

References $title.

Referenced by ilLTIDataConnector\loadGlobalToolConsumerSettings(), and ilLTIDataConnector\loadObjectToolConsumerSettings().

+ Here is the caller graph for this function:

Field Documentation

◆ $description

ilLTIToolConsumer::$description = ''
protected

Definition at line 34 of file class.ilLTIToolConsumer.php.

Referenced by getDescription(), and setDescription().

◆ $ext_consumer_id

ilLTIToolConsumer::$ext_consumer_id = 0
protected

Definition at line 24 of file class.ilLTIToolConsumer.php.

Referenced by getExtConsumerId().

◆ $prefix

ilLTIToolConsumer::$prefix = ''
protected

Definition at line 39 of file class.ilLTIToolConsumer.php.

Referenced by getPrefix(), and setPrefix().

◆ $ref_id

ilLTIToolConsumer::$ref_id
protected

Definition at line 18 of file class.ilLTIToolConsumer.php.

Referenced by getRefId().

◆ $role

ilLTIToolConsumer::$role = 0
protected

Definition at line 49 of file class.ilLTIToolConsumer.php.

Referenced by getRole().

◆ $title

ilLTIToolConsumer::$title = ''
protected

Definition at line 29 of file class.ilLTIToolConsumer.php.

Referenced by getTitle(), and setTitle().

◆ $user_language

ilLTIToolConsumer::$user_language = ''
protected

Definition at line 44 of file class.ilLTIToolConsumer.php.

Referenced by getLanguage().


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