ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilNewsCache Class Reference

News cache. More...

+ Inheritance diagram for ilNewsCache:
+ Collaboration diagram for ilNewsCache:

Public Member Functions

 __construct ()
 Constructor. More...
 
 isDisabled ()
 Check if cache is disabled. More...
 
 readEntry ($a_id)
 Read an entry. More...
 
 storeEntry ($a_id, $a_value)
 Id is user_id:ref_id, we store ref_if additionally. More...
 
- Public Member Functions inherited from ilCache
 __construct ($a_component, $a_cache_name, $a_use_long_content=false)
 Constructor. More...
 
 isDisabled ()
 Check if cache is disabled Forced if member view is active. More...
 
 setComponent ($a_val)
 Set component. More...
 
 setExpiresAfter ($a_val)
 Set expires after x seconds. More...
 
 getExpiresAfter ()
 Get expires after x seconds. More...
 
 getEntry ($a_id)
 Get entry. More...
 
 getLastAccessStatus ()
 Last access. More...
 
 storeEntry ($a_id, $a_value, $a_int_key1=null, $a_int_key2=null, $a_text_key1=null, $a_text_key2=null)
 Store entry. More...
 
 deleteByAdditionalKeys ($a_int_key1=null, $a_int_key2=null, $a_text_key1=null, $a_text_key2=null)
 Delete by additional keys. More...
 
 deleteAllEntries ()
 Delete all entries of cache. More...
 
 deleteEntry ($a_id)
 Delete entry. More...
 

Static Public Attributes

static $disabled = false
 

Additional Inherited Members

- Protected Member Functions inherited from ilCache
 getComponent ()
 Get component. More...
 
 setName ($a_val)
 Set name. More...
 
 getName ()
 Get name. More...
 
 setUseLongContent ($a_val)
 Set use long content. More...
 
 getUseLongContent ()
 Get use long content. More...
 
 readEntry ($a_id)
 Read entry. More...
 

Detailed Description

News cache.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 13 of file class.ilNewsCache.php.

Constructor & Destructor Documentation

◆ __construct()

ilNewsCache::__construct ( )

Constructor.

Parameters

return

Definition at line 23 of file class.ilNewsCache.php.

24 {
25 global $ilSetting;
26
27 $news_set = new ilSetting("news");
28 $news_set->get("acc_cache_mins");
29
30 parent::__construct("ServicesNews", "News", true);
31 $this->setExpiresAfter($news_set->get("acc_cache_mins") * 60);
32 if ((int) $news_set->get("acc_cache_mins") == 0)
33 {
34 self::$disabled = true;
35 }
36 }
setExpiresAfter($a_val)
Set expires after x seconds.
ILIAS Setting Class.
global $ilSetting
Definition: privfeed.php:40

References $ilSetting, and ilCache\setExpiresAfter().

+ Here is the call graph for this function:

Member Function Documentation

◆ isDisabled()

ilNewsCache::isDisabled ( )

Check if cache is disabled.

Returns

Reimplemented from ilCache.

Definition at line 42 of file class.ilNewsCache.php.

43 {
44 return self::$disabled or parent::isDisabled();
45 }

Referenced by readEntry(), and storeEntry().

+ Here is the caller graph for this function:

◆ readEntry()

ilNewsCache::readEntry (   $a_id)

Read an entry.

Reimplemented from ilCache.

Definition at line 51 of file class.ilNewsCache.php.

52 {
53 if (!$this->isDisabled())
54 {
55 return parent::readEntry($a_id);
56 }
57 return false;
58 }
isDisabled()
Check if cache is disabled.

References isDisabled().

+ Here is the call graph for this function:

◆ storeEntry()

ilNewsCache::storeEntry (   $a_id,
  $a_value 
)

Id is user_id:ref_id, we store ref_if additionally.

Definition at line 64 of file class.ilNewsCache.php.

65 {
66 global $ilSetting;
67 if(!$this->isDisabled())
68 {
69 parent::storeEntry($a_id, $a_value);
70 }
71 }

References $ilSetting, and isDisabled().

+ Here is the call graph for this function:

Field Documentation

◆ $disabled

ilNewsCache::$disabled = false
static

Definition at line 15 of file class.ilNewsCache.php.


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