ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilPageContentUsage Class Reference

Saves usages of page content elements in pages. More...

+ Collaboration diagram for ilPageContentUsage:

Public Member Functions

 getUsages ($a_pc_type, $a_pc_id, $a_incl_hist=true)
 Get usages. More...
 
 getUsagesOfPage ($a_usage_id, $a_usage_type, $a_hist_nr=0, $a_all_hist_nrs=false, $a_lang="-")
 Get page content usages for page. More...
 

Static Public Member Functions

static saveUsage ($a_pc_type, $a_pc_id, $a_usage_type, $a_usage_id, $a_usage_hist_nr=0, $a_lang="-")
 Save usages. More...
 
static deleteAllUsages ($a_pc_type, $a_usage_type, $a_usage_id, $a_usage_hist_nr=0, $a_lang="-")
 Delete all usages. More...
 

Detailed Description

Saves usages of page content elements in pages.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilPageContentUsage.php.

Member Function Documentation

◆ deleteAllUsages()

static ilPageContentUsage::deleteAllUsages (   $a_pc_type,
  $a_usage_type,
  $a_usage_id,
  $a_usage_hist_nr = 0,
  $a_lang = "-" 
)
static

Delete all usages.

Definition at line 34 of file class.ilPageContentUsage.php.

35 {
36 global $ilDB;
37
38 $and_hist = ($a_usage_hist_nr !== false)
39 ? " AND usage_hist_nr = ".$ilDB->quote((int) $a_usage_hist_nr, "integer")
40 : "";
41
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").
46 $and_hist.
47 " AND pc_type = ".$ilDB->quote($a_pc_type, "text"));
48 }
global $ilDB

References $ilDB.

Referenced by ilPCContentInclude\beforePageDelete(), ilPCSkills\beforePageDelete(), ilPCContentInclude\saveContentIncludeUsage(), and ilPCSkills\saveSkillUsage().

+ Here is the caller graph for this function:

◆ getUsages()

ilPageContentUsage::getUsages (   $a_pc_type,
  $a_pc_id,
  $a_incl_hist = true 
)

Get usages.

Definition at line 53 of file class.ilPageContentUsage.php.

54 {
55 global $ilDB;
56
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");
60
61 if (!$a_incl_hist)
62 {
63 $q.= " AND usage_hist_nr = ".$ilDB->quote(0, "integer");
64 }
65
66 $set = $ilDB->query($q);
67 $usages = array();
68 while ($rec = $ilDB->fetchAssoc($set))
69 {
70 $usages[] = $rec;
71 }
72 return $usages;
73 }

References $ilDB.

Referenced by ilObjMediaPoolGUI\confirmRemove().

+ Here is the caller graph for this function:

◆ getUsagesOfPage()

ilPageContentUsage::getUsagesOfPage (   $a_usage_id,
  $a_usage_type,
  $a_hist_nr = 0,
  $a_all_hist_nrs = false,
  $a_lang = "-" 
)

Get page content usages for page.

Parameters

return

Definition at line 81 of file class.ilPageContentUsage.php.

82 {
83 global $ilDB;
84
85 if (!$a_all_hist_nrs)
86 {
87 $hist_str = " AND usage_hist_nr = ".$ilDB->quote($a_hist_nr, "integer");
88 }
89
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").
94 $hist_str
95 );
96
97 $usages = array();
98 while ($rec = $ilDB->fetchAssoc($set))
99 {
100 $usages[$rec["pc_type"].":".$rec["pc_id"]] = array(
101 "type" => $rec["pc_type"],
102 "id" => $rec["pc_id"]
103 );
104 }
105
106 return $usages;
107 }

References $ilDB.

Referenced by ilCOPageHTMLExport\collectPageElements(), and ilObjContentObject\exportHTMLPages().

+ Here is the caller graph for this function:

◆ saveUsage()

static ilPageContentUsage::saveUsage (   $a_pc_type,
  $a_pc_id,
  $a_usage_type,
  $a_usage_id,
  $a_usage_hist_nr = 0,
  $a_lang = "-" 
)
static

Save usages.

Definition at line 17 of file class.ilPageContentUsage.php.

18 {
19 global $ilDB;
20
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)
28 ),array());
29 }

References $ilDB.

Referenced by ilPCContentInclude\saveContentIncludeUsage(), and ilPCSkills\saveSkillUsage().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: