ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
ilForumNotificationCache Class Reference

Class ilForumNotificationCache. More...

+ Collaboration diagram for ilForumNotificationCache:

Public Member Functions

 fetch (string $id)
 
 store (string $key, $data)
 
 exists (string $id)
 
 createKeyByValues (array $values)
 

Private Attributes

array $storage = []
 

Detailed Description

Member Function Documentation

◆ createKeyByValues()

ilForumNotificationCache::createKeyByValues ( array  $values)
Parameters
array$values
Returns
string An“ MD5 encoded key based on the given arrays

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

62 : string
63 {
64 foreach ($values as &$value) {
65 if ($value !== null && !is_scalar($value)) {
66 throw new InvalidArgumentException(sprintf(
67 "Value %s is not scalar and can't be used to build a key",
68 print_r($value, true)
69 ));
70 }
71
72 $value = (string) $value;
73 }
74
75 return md5(implode('|', $values));
76 }

◆ exists()

ilForumNotificationCache::exists ( string  $id)

Definition at line 53 of file class.ilForumNotificationCache.php.

53 : bool
54 {
55 return array_key_exists($id, $this->storage);
56 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id.

Referenced by fetch().

+ Here is the caller graph for this function:

◆ fetch()

ilForumNotificationCache::fetch ( string  $id)
Parameters
string$id
Returns
mixed

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

35 {
36 if (false === $this->exists($id)) {
37 throw new InvalidArgumentException('Storage id doesn\'t exist');
38 }
39
40 return $this->storage[$id];
41 }

References $id, and exists().

+ Here is the call graph for this function:

◆ store()

ilForumNotificationCache::store ( string  $key,
  $data 
)
Parameters
string$key
mixed$data
Returns
void

Definition at line 48 of file class.ilForumNotificationCache.php.

48 : void
49 {
50 $this->storage[$key] = $data;
51 }
string $key
Consumer key/client ID value.
Definition: System.php:193

References $data, and ILIAS\LTI\ToolProvider\$key.

Field Documentation

◆ $storage

array ilForumNotificationCache::$storage = []
private

Definition at line 28 of file class.ilForumNotificationCache.php.


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