ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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:25

Member Function Documentation

◆ affectedRows()

arConnectorCache::affectedRows ( ActiveRecordList  $activeRecordList)

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

References arConnector\affectedRows().

168  : int
169  {
170  return $this->arConnector->affectedRows($activeRecordList);
171  }
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 153 of file class.arConnectorCache.php.

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

153  : void
154  {
155  $this->arConnector->delete($activeRecord);
156  $key = $this->buildCacheKey($activeRecord);
157  $this->cache_container->delete($key);
158  }
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 176 of file class.arConnectorCache.php.

References arConnector\quote().

176  : string
177  {
178  return $this->arConnector->quote($value, $type);
179  }
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(), 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(function ($value): ?array {
125  return is_array($value) ? $value : null;
126  })
127  );
128  if (is_array($cached_value)) {
129  return array_map(function ($result): \stdClass {
130  return (object) $result;
131  }, $cached_value);
132  }
133  }
134 
135  $results = $this->arConnector->read($activeRecord);
136 
137  $this->cache_container->set(
138  $key,
139  array_map(function ($result): array {
140  return (array) $result;
141  }, $results)
142  );
143 
144  return $results;
145  }
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...
buildCacheKey(ActiveRecord $activeRecord)
$results
+ Here is the call graph for this function:

◆ readSet()

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

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

References arConnector\readSet().

163  : array
164  {
165  return $this->arConnector->readSet($activeRecordList);
166  }
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 189 of file class.arConnectorCache.php.

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

Referenced by create(), and update().

189  : void
190  {
191  $key = $this->buildCacheKey($activeRecord);
192  $value = $activeRecord->asArray();
193 
194  $this->cache_container->set($key, $value);
195  }
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 147 of file class.arConnectorCache.php.

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

147  : void
148  {
149  $this->arConnector->update($activeRecord);
150  $this->storeActiveRecordInCache($activeRecord);
151  }
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 181 of file class.arConnectorCache.php.

References arConnector\updateIndices().

181  : void
182  {
183  $this->arConnector->updateIndices($activeRecord);
184  }
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: