ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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, $a_int_key1=null, $a_int_key2=null, $a_text_key1=null, $a_text_key2=null)
 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
 

Protected Attributes

 $settings
 

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

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

References $DIC, $ilSetting, ilCache\setExpiresAfter(), and settings().

29  {
30  global $DIC;
31 
32  $this->settings = $DIC->settings();
33  $ilSetting = $DIC->settings();
34 
35  $news_set = new ilSetting("news");
36  $news_set->get("acc_cache_mins");
37 
38  parent::__construct("ServicesNews", "News", true);
39  $this->setExpiresAfter($news_set->get("acc_cache_mins") * 60);
40  if ((int) $news_set->get("acc_cache_mins") == 0) {
41  self::$disabled = true;
42  }
43  }
settings()
Definition: settings.php:2
global $DIC
Definition: saml.php:7
global $ilSetting
Definition: privfeed.php:17
setExpiresAfter($a_val)
Set expires after x seconds.
+ Here is the call graph for this function:

Member Function Documentation

◆ isDisabled()

ilNewsCache::isDisabled ( )

Check if cache is disabled.

Returns

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

Referenced by readEntry(), and storeEntry().

50  {
51  return self::$disabled or parent::isDisabled();
52  }
+ Here is the caller graph for this function:

◆ readEntry()

ilNewsCache::readEntry (   $a_id)

Read an entry.

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

References isDisabled().

59  {
60  if (!$this->isDisabled()) {
61  return parent::readEntry($a_id);
62  }
63  return false;
64  }
isDisabled()
Check if cache is disabled.
+ Here is the call graph for this function:

◆ storeEntry()

ilNewsCache::storeEntry (   $a_id,
  $a_value,
  $a_int_key1 = null,
  $a_int_key2 = null,
  $a_text_key1 = null,
  $a_text_key2 = null 
)

Id is user_id:ref_id, we store ref_if additionally.

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

References $ilSetting, $settings, and isDisabled().

77  {
79  if (!$this->isDisabled()) {
80  parent::storeEntry($a_id, $a_value);
81  }
82  }
isDisabled()
Check if cache is disabled.
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:

Field Documentation

◆ $disabled

ilNewsCache::$disabled = false
static

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

◆ $settings

ilNewsCache::$settings
protected

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

Referenced by storeEntry().


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