ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ConsumerNonce.php
Go to the documentation of this file.
1 <?php
2 
4 
15 {
16 
20  const MAX_NONCE_AGE = 30; // in minutes
21 
27  public $expires = null;
28 
34  private $consumer = null;
40  private $value = null;
41 
48  public function __construct($consumer, $value = null)
49  {
50 
51  $this->consumer = $consumer;
52  $this->value = $value;
53  $this->expires = time() + (self::MAX_NONCE_AGE * 60);
54 
55  }
56 
62  public function load()
63  {
64 
65  return $this->consumer->getDataConnector()->loadConsumerNonce($this);
66 
67  }
68 
74  public function save()
75  {
76 
77  return $this->consumer->getDataConnector()->saveConsumerNonce($this);
78 
79  }
80 
86  public function getConsumer()
87  {
88 
89  return $this->consumer;
90 
91  }
92 
98  public function getValue()
99  {
100 
101  return $this->value;
102 
103  }
104 
105 }
Class to represent a tool consumer nonce.
$consumer
Tool Consumer to which this nonce applies.
const MAX_NONCE_AGE
Maximum age nonce values will be retained for (in minutes).
$expires
Date/time when the nonce value expires.
save()
Save a nonce value in the database.
__construct($consumer, $value=null)
Class constructor.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
load()
Load a nonce value from the database.