ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
IMSGlobal\LTI\ToolProvider\ConsumerNonce Class Reference

Class to represent a tool consumer nonce. More...

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

Public Member Functions

 __construct ($consumer, $value=null)
 Class constructor. More...
 
 load ()
 Load a nonce value from the database. More...
 
 save ()
 Save a nonce value in the database. More...
 
 getConsumer ()
 Get tool consumer. More...
 
 getValue ()
 Get outcome value. More...
 

Data Fields

const MAX_NONCE_AGE = 30
 Maximum age nonce values will be retained for (in minutes). More...
 
 $expires = null
 Date/time when the nonce value expires. More...
 

Private Attributes

 $consumer = null
 Tool Consumer to which this nonce applies. More...
 
 $value = null
 Nonce value. More...
 

Detailed Description

Class to represent a tool consumer nonce.

Author
Stephen P Vickers svick.nosp@m.ers@.nosp@m.imsgl.nosp@m.obal.nosp@m..org
Date
2016
Version
3.0.2 http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0

Definition at line 14 of file ConsumerNonce.php.

Constructor & Destructor Documentation

◆ __construct()

IMSGlobal\LTI\ToolProvider\ConsumerNonce::__construct (   $consumer,
  $value = null 
)

Class constructor.

Parameters
ToolConsumer$consumerConsumer object
string$valueNonce value (optional, default is null)

Definition at line 48 of file ConsumerNonce.php.

References IMSGlobal\LTI\ToolProvider\ConsumerNonce\$consumer, IMSGlobal\LTI\ToolProvider\ConsumerNonce\$value, and time.

49  {
50 
51  $this->consumer = $consumer;
52  $this->value = $value;
53  $this->expires = time() + (self::MAX_NONCE_AGE * 60);
54 
55  }
$consumer
Tool Consumer to which this nonce applies.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.

Member Function Documentation

◆ getConsumer()

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

Get tool consumer.

Returns
ToolConsumer Consumer for this nonce

Definition at line 86 of file ConsumerNonce.php.

References IMSGlobal\LTI\ToolProvider\ConsumerNonce\$consumer.

87  {
88 
89  return $this->consumer;
90 
91  }
$consumer
Tool Consumer to which this nonce applies.

◆ getValue()

IMSGlobal\LTI\ToolProvider\ConsumerNonce::getValue ( )

Get outcome value.

Returns
string Outcome value

Definition at line 98 of file ConsumerNonce.php.

References IMSGlobal\LTI\ToolProvider\ConsumerNonce\$value.

99  {
100 
101  return $this->value;
102 
103  }

◆ load()

IMSGlobal\LTI\ToolProvider\ConsumerNonce::load ( )

Load a nonce value from the database.

Returns
boolean True if the nonce value was successfully loaded

Definition at line 62 of file ConsumerNonce.php.

63  {
64 
65  return $this->consumer->getDataConnector()->loadConsumerNonce($this);
66 
67  }

◆ save()

IMSGlobal\LTI\ToolProvider\ConsumerNonce::save ( )

Save a nonce value in the database.

Returns
boolean True if the nonce value was successfully saved

Definition at line 74 of file ConsumerNonce.php.

75  {
76 
77  return $this->consumer->getDataConnector()->saveConsumerNonce($this);
78 
79  }

Field Documentation

◆ $consumer

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

Tool Consumer to which this nonce applies.

Definition at line 34 of file ConsumerNonce.php.

Referenced by IMSGlobal\LTI\ToolProvider\ConsumerNonce\__construct(), and IMSGlobal\LTI\ToolProvider\ConsumerNonce\getConsumer().

◆ $expires

int IMSGlobal\LTI\ToolProvider\ConsumerNonce::$expires = null

Date/time when the nonce value expires.

Definition at line 27 of file ConsumerNonce.php.

◆ $value

string IMSGlobal\LTI\ToolProvider\ConsumerNonce::$value = null
private

◆ MAX_NONCE_AGE

const IMSGlobal\LTI\ToolProvider\ConsumerNonce::MAX_NONCE_AGE = 30

Maximum age nonce values will be retained for (in minutes).

Definition at line 20 of file ConsumerNonce.php.


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