ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilForumNotificationCache.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
10{
12 private $storage = array();
13
19 public function fetch(string $id)
20 {
21 if (false === $this->exists($id)) {
22 throw new InvalidArgumentException('Storage id doesn\'t exist');
23 }
24
25 return $this->storage[$id];
26 }
27
32 public function store(string $key, $data)
33 {
34 $this->storage[$key] = $data;
35 }
36
43 public function exists(string $id)
44 {
45 return array_key_exists($id, $this->storage);
46 }
47
53 public function createKeyByValues(array $values)
54 {
55 $cacheKey = md5(implode('|', $values));
56
57 return $cacheKey;
58 }
59}
An exception for terminatinating execution or to throw for unit testing.
Class ilForumNotificationCache.
exists(string $id)
Checks if the current id exists.
$key
Definition: croninfo.php:18
if(!array_key_exists('StateId', $_REQUEST)) $id
$values
$data
Definition: bench.php:6