ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
Returns
string An“ MD5 encoded key based on the given arrays

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

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

◆ exists()

ilForumNotificationCache::exists ( string  $id)

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

50 : bool
51 {
52 return array_key_exists($id, $this->storage);
53 }
$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)
Returns
mixed

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

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

References $id, and exists().

+ Here is the call graph for this function:

◆ store()

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

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

45 : void
46 {
47 $this->storage[$key] = $data;
48 }

References $data.

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: