43 bool $a_use_long_content =
false 61 $this->component = $a_val;
69 protected function setName(
string $a_val): void
81 $this->use_long_content = $a_val;
94 $this->expires_after = $a_val;
102 final public function getEntry(
string $a_id): ?string
105 $this->last_access =
"hit";
108 $this->last_access =
"miss";
120 $query =
"SELECT value FROM $table WHERE " .
121 "component = " . $ilDB->quote($this->
getComponent(),
"text") .
" AND " .
122 "name = " . $ilDB->quote($this->
getName(),
"text") .
" AND " .
123 "expire_time > " . $ilDB->quote(time(),
"integer") .
" AND " .
125 "entry_id = " . $ilDB->quote($a_id,
"text");
127 $set = $ilDB->query($query);
129 if ($rec = $ilDB->fetchAssoc($set)) {
130 $this->entry = $rec[
"value"];
145 ?
int $a_int_key1 =
null,
146 ?
int $a_int_key2 =
null,
147 ?
string $a_text_key1 =
null,
148 ?
string $a_text_key2 =
null 160 if (strlen($a_value) > 4000 && $type ==
"text") {
164 $set = $ilDB->replace($table, array(
166 "name" => array(
"text", $this->
getName()),
167 "entry_id" => array(
"text", $a_id)
169 "value" => array($type, $a_value),
170 "int_key_1" => array(
"integer", $a_int_key1),
171 "int_key_2" => array(
"integer", $a_int_key2),
172 "text_key_1" => array(
"text", $a_text_key1),
173 "text_key_2" => array(
"text", $a_text_key2),
174 "expire_time" => array(
"integer", (time() + $this->
getExpiresAfter())),
179 $random = new \Random\Randomizer();
180 $num = $random->getInt(1, 2000);
183 "DELETE FROM $table WHERE " .
185 " OR expire_time < " . $ilDB->quote(time(),
"integer")
191 ?
int $a_int_key1 =
null,
192 ?
int $a_int_key2 =
null,
193 ?
string $a_text_key1 =
null,
194 ?
string $a_text_key2 =
null 202 $q =
"DELETE FROM $table WHERE " .
203 "component = " . $ilDB->quote($this->
getComponent(),
"text") .
204 " AND name = " . $ilDB->quote($this->
getName(),
"text");
206 $fds = array(
"int_key_1" => array(
"v" => $a_int_key1,
"t" =>
"integer"),
207 "int_key_2" => array(
"v" => $a_int_key2,
"t" =>
"integer"),
208 "text_key_1" => array(
"v" => $a_text_key1,
"t" =>
"text"),
209 "text_key_2" => array(
"v" => $a_text_key2,
"t" =>
"text"));
211 foreach ($fds as $k => $fd) {
212 if (!is_null($fd[
"v"])) {
213 $q .= $sep .
" " . $k .
" = " . $ilDB->quote($fd[
"v"], $fd[
"t"]);
217 $ilDB->manipulate(
$q);
228 $q =
"DELETE FROM $table WHERE " .
229 "component = " . $ilDB->quote($this->
getComponent(),
"text") .
230 " AND name = " . $ilDB->quote($this->
getName(),
"text");
231 $ilDB->manipulate(
$q);
242 $ilDB->manipulate(
"DELETE FROM " . $table .
" WHERE " 243 .
" entry_id = " . $ilDB->quote($a_id,
"text")
244 .
" AND component = " . $ilDB->quote($this->
getComponent(),
"text") .
245 " AND name = " . $ilDB->quote($this->
getName(),
"text"));
deleteByAdditionalKeys(?int $a_int_key1=null, ?int $a_int_key2=null, ?string $a_text_key1=null, ?string $a_text_key2=null)
setUseLongContent(bool $a_val)
isDisabled()
Check if cache is disabled Forced if member view is active.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setExpiresAfter(int $a_val)
Set expires after x seconds.
const ILIAS_VERSION_NUMERIC
deleteEntry(string $a_id)
setComponent(string $a_val)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
storeEntry(string $a_id, string $a_value, ?int $a_int_key1=null, ?int $a_int_key2=null, ?string $a_text_key1=null, ?string $a_text_key2=null)
__construct(string $a_component, string $a_cache_name, bool $a_use_long_content=false)