17 static function saveUsage($a_pc_type, $a_pc_id, $a_usage_type, $a_usage_id, $a_usage_hist_nr = 0)
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_hist_nr" => array(
"integer", (
int) $a_usage_hist_nr)
33 static function deleteAllUsages($a_pc_type, $a_usage_type, $a_usage_id, $a_usage_hist_nr = 0)
37 $ilDB->manipulate($q =
"DELETE FROM page_pc_usage WHERE usage_type = ".
38 $ilDB->quote($a_usage_type,
"text").
39 " AND usage_id = ".$ilDB->quote((
int) $a_usage_id,
"integer").
40 " AND usage_hist_nr = ".$ilDB->quote((
int) $a_usage_hist_nr,
"integer").
41 " AND pc_type = ".$ilDB->quote($a_pc_type,
"text"));
47 function getUsages($a_pc_type, $a_pc_id, $a_incl_hist =
true)
51 $q =
"SELECT * FROM page_pc_usage ".
52 " WHERE pc_type = ".$ilDB->quote($a_pc_type,
"text").
53 " AND pc_id = ".$ilDB->quote($a_pc_id,
"integer");
57 $q.=
" AND usage_hist_nr = ".$ilDB->quote(0,
"integer");
60 $set = $ilDB->query($q);
62 while ($rec = $ilDB->fetchAssoc($set))
75 function getUsagesOfPage($a_usage_id, $a_usage_type, $a_hist_nr = 0, $a_all_hist_nrs =
false)
81 $hist_str =
" AND usage_hist_nr = ".$ilDB->quote($a_hist_nr,
"integer");
84 $set = $ilDB->query(
"SELECT pc_type, pc_id FROM page_pc_usage WHERE ".
85 " usage_id = ".$ilDB->quote($a_usage_id,
"integer").
" AND ".
86 " usage_type = ".$ilDB->quote($a_usage_type,
"text").
91 while ($rec = $ilDB->fetchAssoc($set))
93 $usages[$rec[
"pc_type"].
":".$rec[
"pc_id"]] = array(
94 "type" => $rec[
"pc_type"],