17 static function saveUsage($a_pc_type, $a_pc_id, $a_usage_type, $a_usage_id, $a_usage_hist_nr = 0, $a_lang =
"-")
21 $ilDB->replace(
"page_pc_usage", array (
22 "pc_type" => array(
"text", $a_pc_type),
23 "pc_id" => array(
"integer", (
int) $a_pc_id),
24 "usage_type" => array(
"text", $a_usage_type),
25 "usage_id" => array(
"integer", (
int) $a_usage_id),
26 "usage_lang" => array(
"text", $a_lang),
27 "usage_hist_nr" => array(
"integer", (
int) $a_usage_hist_nr)
34 static function deleteAllUsages($a_pc_type, $a_usage_type, $a_usage_id, $a_usage_hist_nr = 0, $a_lang =
"-")
38 $and_hist = ($a_usage_hist_nr !==
false)
39 ?
" AND usage_hist_nr = ".$ilDB->quote((
int) $a_usage_hist_nr,
"integer")
42 $ilDB->manipulate($q =
"DELETE FROM page_pc_usage WHERE usage_type = ".
43 $ilDB->quote($a_usage_type,
"text").
44 " AND usage_id = ".$ilDB->quote((
int) $a_usage_id,
"integer").
45 " AND usage_lang = ".$ilDB->quote($a_usage_lang,
"text").
47 " AND pc_type = ".$ilDB->quote($a_pc_type,
"text"));
53 function getUsages($a_pc_type, $a_pc_id, $a_incl_hist =
true)
57 $q =
"SELECT * FROM page_pc_usage ".
58 " WHERE pc_type = ".$ilDB->quote($a_pc_type,
"text").
59 " AND pc_id = ".$ilDB->quote($a_pc_id,
"integer");
63 $q.=
" AND usage_hist_nr = ".$ilDB->quote(0,
"integer");
66 $set = $ilDB->query($q);
68 while ($rec = $ilDB->fetchAssoc($set))
81 function getUsagesOfPage($a_usage_id, $a_usage_type, $a_hist_nr = 0, $a_all_hist_nrs =
false, $a_lang =
"-")
87 $hist_str =
" AND usage_hist_nr = ".$ilDB->quote($a_hist_nr,
"integer");
90 $set = $ilDB->query(
"SELECT pc_type, pc_id FROM page_pc_usage WHERE ".
91 " usage_id = ".$ilDB->quote($a_usage_id,
"integer").
" AND ".
92 " usage_lang = ".$ilDB->quote($a_lang,
"text").
" AND ".
93 " usage_type = ".$ilDB->quote($a_usage_type,
"text").
98 while ($rec = $ilDB->fetchAssoc($set))
100 $usages[$rec[
"pc_type"].
":".$rec[
"pc_id"]] = array(
101 "type" => $rec[
"pc_type"],
102 "id" => $rec[
"pc_id"]