ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
arConnectorCache Class Reference

Class ilGSStorageCache. More...

+ Inheritance diagram for arConnectorCache:
+ Collaboration diagram for arConnectorCache:

Public Member Functions

 __construct (private arConnector $arConnector)
 ilGSStorageCache constructor. More...
 
 getContainerKey ()
 
 isForced ()
 
 nextID (ActiveRecord $activeRecord)
 
 checkConnection (ActiveRecord $activeRecord)
 
 installDatabase (ActiveRecord $activeRecord, array $fields)
 
 updateDatabase (ActiveRecord $activeRecord)
 
 resetDatabase (ActiveRecord $activeRecord)
 
 truncateDatabase (ActiveRecord $activeRecord)
 
 checkTableExists (ActiveRecord $activeRecord)
 
 checkFieldExists (ActiveRecord $activeRecord, string $field_name)
 
 removeField (ActiveRecord $activeRecord, string $field_name)
 
 renameField (ActiveRecord $activeRecord, string $old_name, string $new_name)
 
 create (ActiveRecord $activeRecord)
 
 read (ActiveRecord $activeRecord)
 
 update (ActiveRecord $activeRecord)
 
 delete (ActiveRecord $activeRecord)
 
 readSet (ActiveRecordList $activeRecordList)
 
 affectedRows (ActiveRecordList $activeRecordList)
 
 quote ($value, string $type)
 
 updateIndices (ActiveRecord $activeRecord)
 
- Public Member Functions inherited from arConnector
 nextID (ActiveRecord $activeRecord)
 
 checkConnection (ActiveRecord $activeRecord)
 
 installDatabase (ActiveRecord $activeRecord, array $fields)
 
 updateDatabase (ActiveRecord $activeRecord)
 
 resetDatabase (ActiveRecord $activeRecord)
 
 truncateDatabase (ActiveRecord $activeRecord)
 
 checkTableExists (ActiveRecord $activeRecord)
 
 checkFieldExists (ActiveRecord $activeRecord, string $field_name)
 
 removeField (ActiveRecord $activeRecord, string $field_name)
 
 renameField (ActiveRecord $activeRecord, string $old_name, string $new_name)
 
 create (ActiveRecord $activeRecord)
 
 read (ActiveRecord $activeRecord)
 
 update (ActiveRecord $activeRecord)
 
 delete (ActiveRecord $activeRecord)
 
 readSet (ActiveRecordList $activeRecordList)
 
 affectedRows (ActiveRecordList $activeRecordList)
 
 quote (mixed $value, string $type)
 
 updateIndices (ActiveRecord $activeRecord)
 
 fixDate (string $value)
 

Protected Member Functions

 buildCacheKey (ActiveRecord $activeRecord)
 

Private Member Functions

 storeActiveRecordInCache (ActiveRecord $activeRecord)
 Stores an active record into the Cache. More...
 

Private Attributes

Container $cache_container
 

Detailed Description

Class ilGSStorageCache.

Author
Nicolas Schäfli ns@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 27 of file class.arConnectorCache.php.

Constructor & Destructor Documentation

◆ __construct()

arConnectorCache::__construct ( private arConnector  $arConnector)

ilGSStorageCache constructor.

Parameters
int$ttl

Definition at line 35 of file class.arConnectorCache.php.

References $DIC.

36  {
37  global $DIC;
38  $this->cache_container = $DIC->globalCache()->get($this);
39  }
global $DIC
Definition: shib_login.php:22

Member Function Documentation

◆ affectedRows()

arConnectorCache::affectedRows ( ActiveRecordList  $activeRecordList)

Definition at line 162 of file class.arConnectorCache.php.

References arConnector\affectedRows().

162  : int
163  {
164  return $this->arConnector->affectedRows($activeRecordList);
165  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
affectedRows(ActiveRecordList $activeRecordList)
+ Here is the call graph for this function:

◆ buildCacheKey()

arConnectorCache::buildCacheKey ( ActiveRecord  $activeRecord)
protected

Definition at line 41 of file class.arConnectorCache.php.

References ActiveRecord\getConnectorContainerName(), and ActiveRecord\getPrimaryFieldValue().

Referenced by delete(), read(), and storeActiveRecordInCache().

41  : string
42  {
43  return $activeRecord->getConnectorContainerName() . "_" . $activeRecord->getPrimaryFieldValue();
44  }
getConnectorContainerName()
Return the Name of your Connector Table
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkConnection()

arConnectorCache::checkConnection ( ActiveRecord  $activeRecord)

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

References arConnector\checkConnection().

64  : bool
65  {
66  return $this->arConnector->checkConnection($activeRecord);
67  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkConnection(ActiveRecord $activeRecord)
+ Here is the call graph for this function:

◆ checkFieldExists()

arConnectorCache::checkFieldExists ( ActiveRecord  $activeRecord,
string  $field_name 
)

Definition at line 94 of file class.arConnectorCache.php.

References arConnector\checkFieldExists().

94  : bool
95  {
96  return $this->arConnector->checkFieldExists($activeRecord, $field_name);
97  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkFieldExists(ActiveRecord $activeRecord, string $field_name)
+ Here is the call graph for this function:

◆ checkTableExists()

arConnectorCache::checkTableExists ( ActiveRecord  $activeRecord)

Definition at line 89 of file class.arConnectorCache.php.

References arConnector\checkTableExists().

89  : bool
90  {
91  return $this->arConnector->checkTableExists($activeRecord);
92  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkTableExists(ActiveRecord $activeRecord)
+ Here is the call graph for this function:

◆ create()

arConnectorCache::create ( ActiveRecord  $activeRecord)

Definition at line 109 of file class.arConnectorCache.php.

References arConnector\create(), and storeActiveRecordInCache().

109  : void
110  {
111  $this->arConnector->create($activeRecord);
112  $this->storeActiveRecordInCache($activeRecord);
113  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
create(ActiveRecord $activeRecord)
storeActiveRecordInCache(ActiveRecord $activeRecord)
Stores an active record into the Cache.
+ Here is the call graph for this function:

◆ delete()

arConnectorCache::delete ( ActiveRecord  $activeRecord)

Definition at line 147 of file class.arConnectorCache.php.

References buildCacheKey(), and arConnector\delete().

147  : void
148  {
149  $this->arConnector->delete($activeRecord);
150  $key = $this->buildCacheKey($activeRecord);
151  $this->cache_container->delete($key);
152  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
delete(ActiveRecord $activeRecord)
buildCacheKey(ActiveRecord $activeRecord)
+ Here is the call graph for this function:

◆ getContainerKey()

arConnectorCache::getContainerKey ( )

Implements ILIAS\Cache\Container\Request.

Definition at line 46 of file class.arConnectorCache.php.

46  : string
47  {
48  return 'ar_cache';
49  }

◆ installDatabase()

arConnectorCache::installDatabase ( ActiveRecord  $activeRecord,
array  $fields 
)

Definition at line 69 of file class.arConnectorCache.php.

References arConnector\installDatabase().

69  : bool
70  {
71  return $this->arConnector->installDatabase($activeRecord, $fields);
72  }
installDatabase(ActiveRecord $activeRecord, array $fields)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ isForced()

arConnectorCache::isForced ( )

Implements ILIAS\Cache\Container\Request.

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

51  : bool
52  {
53  return false;
54  }

◆ nextID()

arConnectorCache::nextID ( ActiveRecord  $activeRecord)
Returns
mixed

Definition at line 59 of file class.arConnectorCache.php.

References arConnector\nextID().

60  {
61  return $this->arConnector->nextID($activeRecord);
62  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
nextID(ActiveRecord $activeRecord)
+ Here is the call graph for this function:

◆ quote()

arConnectorCache::quote (   $value,
string  $type 
)
Parameters
$value

Definition at line 170 of file class.arConnectorCache.php.

References arConnector\quote().

170  : string
171  {
172  return $this->arConnector->quote($value, $type);
173  }
quote(mixed $value, string $type)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ read()

arConnectorCache::read ( ActiveRecord  $activeRecord)
Returns
[]|mixed[]

Definition at line 118 of file class.arConnectorCache.php.

References $results, buildCacheKey(), null, and arConnector\read().

118  : array
119  {
120  $key = $this->buildCacheKey($activeRecord);
121  if ($this->cache_container->has($key)) {
122  $cached_value = $this->cache_container->get(
123  $key,
124  new Transformation(fn($value): ?array => is_array($value) ? $value : null)
125  );
126  if (is_array($cached_value)) {
127  return array_map(fn($result): \stdClass => (object) $result, $cached_value);
128  }
129  }
130 
131  $results = $this->arConnector->read($activeRecord);
132 
133  $this->cache_container->set(
134  $key,
135  array_map(fn($result): array => (array) $result, $results)
136  );
137 
138  return $results;
139  }
Transform values according to custom configuration.
read(ActiveRecord $activeRecord)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
buildCacheKey(ActiveRecord $activeRecord)
$results
+ Here is the call graph for this function:

◆ readSet()

arConnectorCache::readSet ( ActiveRecordList  $activeRecordList)
Returns
mixed[]

Definition at line 157 of file class.arConnectorCache.php.

References arConnector\readSet().

157  : array
158  {
159  return $this->arConnector->readSet($activeRecordList);
160  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
readSet(ActiveRecordList $activeRecordList)
+ Here is the call graph for this function:

◆ removeField()

arConnectorCache::removeField ( ActiveRecord  $activeRecord,
string  $field_name 
)

Definition at line 99 of file class.arConnectorCache.php.

References arConnector\removeField().

99  : bool
100  {
101  return $this->arConnector->removeField($activeRecord, $field_name);
102  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
removeField(ActiveRecord $activeRecord, string $field_name)
+ Here is the call graph for this function:

◆ renameField()

arConnectorCache::renameField ( ActiveRecord  $activeRecord,
string  $old_name,
string  $new_name 
)

Definition at line 104 of file class.arConnectorCache.php.

References arConnector\renameField().

104  : bool
105  {
106  return $this->arConnector->renameField($activeRecord, $old_name, $new_name);
107  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
renameField(ActiveRecord $activeRecord, string $old_name, string $new_name)
+ Here is the call graph for this function:

◆ resetDatabase()

arConnectorCache::resetDatabase ( ActiveRecord  $activeRecord)

Definition at line 79 of file class.arConnectorCache.php.

References arConnector\resetDatabase().

79  : bool
80  {
81  return $this->arConnector->resetDatabase($activeRecord);
82  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
resetDatabase(ActiveRecord $activeRecord)
+ Here is the call graph for this function:

◆ storeActiveRecordInCache()

arConnectorCache::storeActiveRecordInCache ( ActiveRecord  $activeRecord)
private

Stores an active record into the Cache.

Definition at line 183 of file class.arConnectorCache.php.

References ActiveRecord\asArray(), and buildCacheKey().

Referenced by create(), and update().

183  : void
184  {
185  $key = $this->buildCacheKey($activeRecord);
186  $value = $activeRecord->asArray();
187 
188  $this->cache_container->set($key, $value);
189  }
buildCacheKey(ActiveRecord $activeRecord)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ truncateDatabase()

arConnectorCache::truncateDatabase ( ActiveRecord  $activeRecord)

Definition at line 84 of file class.arConnectorCache.php.

References arConnector\truncateDatabase().

84  : bool
85  {
86  return $this->arConnector->truncateDatabase($activeRecord);
87  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
truncateDatabase(ActiveRecord $activeRecord)
+ Here is the call graph for this function:

◆ update()

arConnectorCache::update ( ActiveRecord  $activeRecord)

Definition at line 141 of file class.arConnectorCache.php.

References storeActiveRecordInCache(), and arConnector\update().

141  : void
142  {
143  $this->arConnector->update($activeRecord);
144  $this->storeActiveRecordInCache($activeRecord);
145  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
update(ActiveRecord $activeRecord)
storeActiveRecordInCache(ActiveRecord $activeRecord)
Stores an active record into the Cache.
+ Here is the call graph for this function:

◆ updateDatabase()

arConnectorCache::updateDatabase ( ActiveRecord  $activeRecord)

Definition at line 74 of file class.arConnectorCache.php.

References arConnector\updateDatabase().

74  : bool
75  {
76  return $this->arConnector->updateDatabase($activeRecord);
77  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
updateDatabase(ActiveRecord $activeRecord)
+ Here is the call graph for this function:

◆ updateIndices()

arConnectorCache::updateIndices ( ActiveRecord  $activeRecord)

Definition at line 175 of file class.arConnectorCache.php.

References arConnector\updateIndices().

175  : void
176  {
177  $this->arConnector->updateIndices($activeRecord);
178  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
updateIndices(ActiveRecord $activeRecord)
+ Here is the call graph for this function:

Field Documentation

◆ $cache_container

Container arConnectorCache::$cache_container
private

Definition at line 29 of file class.arConnectorCache.php.


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