26 function __construct($a_component, $a_cache_name, $a_use_long_content =
false)
40 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
51 $this->component = $a_val;
61 return $this->component;
91 $this->use_long_content = $a_val;
101 return $this->use_long_content;
111 $this->expires_after = $a_val;
121 return $this->expires_after;
134 $this->last_access =
"hit";
137 $this->last_access =
"miss";
154 $query =
"SELECT value FROM $table WHERE ".
155 "component = ".$ilDB->quote($this->
getComponent(),
"text").
" AND ".
156 "name = ".$ilDB->quote($this->
getName(),
"text").
" AND ".
157 "expire_time > ".$ilDB->quote(time(),
"integer").
" AND ".
159 "entry_id = ".$ilDB->quote($a_id,
"text");
161 $set = $ilDB->query(
$query);
163 if ($rec = $ilDB->fetchAssoc($set))
165 $this->entry = $rec[
"value"];
177 return $this->last_access;
192 function storeEntry($a_id, $a_value, $a_int_key1 = null, $a_int_key2 = null,
193 $a_text_key1 = null, $a_text_key2 = null)
205 if (strlen($a_value) > 4000 &&
$type ==
"text")
210 $set = $ilDB->replace($table, array(
212 "name" => array(
"text", $this->
getName()),
213 "entry_id" => array(
"text", $a_id)
215 "value" => array(
$type, $a_value),
216 "int_key_1" => array(
"integer", $a_int_key1),
217 "int_key_2" => array(
"integer", $a_int_key2),
218 "text_key_1" => array(
"text", $a_text_key1),
219 "text_key_2" => array(
"text", $a_text_key2),
220 "expire_time" => array(
"integer", (
int) (time() + $this->
getExpiresAfter())),
228 $ilDB->manipulate(
"DELETE FROM $table WHERE ".
230 " OR expire_time < ".$ilDB->quote(time(),
"integer")
240 $a_text_key1 = null, $a_text_key2 = null)
248 $q =
"DELETE FROM $table WHERE ".
249 "component = ".$ilDB->quote($this->
getComponent(),
"text").
250 " AND name = ".$ilDB->quote($this->
getName(),
"text");
252 $fds = array(
"int_key_1" => array(
"v" => $a_int_key1,
"t" =>
"integer"),
253 "int_key_2" => array(
"v" => $a_int_key2,
"t" =>
"integer"),
254 "text_key_1" => array(
"v" => $a_text_key1,
"t" =>
"text"),
255 "text_key_2" => array(
"v" => $a_text_key2,
"t" =>
"text"));
257 foreach ($fds as $k => $fd)
259 if (!is_null($fd[
"v"]))
261 $q .= $sep.
" ".$k.
" = ".$ilDB->quote($fd[
"v"], $fd[
"t"]);
265 $ilDB->manipulate(
$q);
279 $q =
"DELETE FROM $table WHERE ".
280 "component = ".$ilDB->quote($this->
getComponent(),
"text").
281 " AND name = ".$ilDB->quote($this->
getName(),
"text");
282 $ilDB->manipulate(
$q);
298 $ilDB->manipulate(
"DELETE FROM ".$table.
" WHERE "
299 .
" entry_id = ".$ilDB->quote($a_id,
"text")
300 .
" AND component = ".$ilDB->quote($this->
getComponent(),
"text").
301 " AND name = ".$ilDB->quote($this->
getName(),
"text"));