36 static function saveUsage($a_pc_type, $a_pc_id, $a_usage_type, $a_usage_id, $a_usage_hist_nr = 0)
40 $ilDB->replace(
"page_pc_usage", array (
41 "pc_type" => array(
"text", $a_pc_type),
42 "pc_id" => array(
"integer", (
int) $a_pc_id),
43 "usage_type" => array(
"text", $a_usage_type),
44 "usage_id" => array(
"integer", (
int) $a_usage_id),
45 "usage_hist_nr" => array(
"integer", (
int) $a_usage_hist_nr)
52 static function deleteAllUsages($a_pc_type, $a_usage_type, $a_usage_id, $a_usage_hist_nr = 0)
56 $ilDB->manipulate($q =
"DELETE FROM page_pc_usage WHERE usage_type = ".
57 $ilDB->quote($a_usage_type,
"text").
58 " AND usage_id = ".$ilDB->quote((
int) $a_usage_id,
"integer").
59 " AND usage_hist_nr = ".$ilDB->quote((
int) $a_usage_hist_nr,
"integer").
60 " AND pc_type = ".$ilDB->quote($a_pc_type,
"text"));
70 $set = $ilDB->query(
"SELECT * FROM page_pc_usage ".
71 " WHERE pc_type = ".$ilDB->quote($a_pc_type,
"text").
72 " AND pc_id = ".$ilDB->quote($a_pc_id,
"integer")
75 while ($rec = $ilDB->fetchAssoc($set))
88 function getUsagesOfPage($a_usage_id, $a_usage_type, $a_hist_nr = 0, $a_all_hist_nrs =
false)
94 $hist_str =
" AND usage_hist_nr = ".$ilDB->quote($a_hist_nr,
"integer");
97 $set = $ilDB->query(
"SELECT pc_type, pc_id FROM page_pc_usage WHERE ".
98 " usage_id = ".$ilDB->quote($a_usage_id,
"integer").
" AND ".
99 " usage_type = ".$ilDB->quote($a_usage_type,
"text").
104 while ($rec = $ilDB->fetchAssoc($set))
106 $usages[$rec[
"pc_type"].
":".$rec[
"pc_id"]] = array(
107 "type" => $rec[
"pc_type"],
108 "id" => $rec[
"pc_id"]