ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

References null.

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ exists()

ilForumNotificationCache::exists ( string  $id)

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

Referenced by fetch().

50  : bool
51  {
52  return array_key_exists($id, $this->storage);
53  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the caller graph for this function:

◆ fetch()

ilForumNotificationCache::fetch ( string  $id)
Returns
mixed

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

References $id, and exists().

34  {
35  if (!$this->exists($id)) {
36  throw new InvalidArgumentException('Storage id doesn\'t exist');
37  }
38 
39  return $this->storage[$id];
40  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ 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.

References $data.

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

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: