Saves usages of page content elements in pages.
More...
Public Member Functions |
| getUsages ($a_pc_type, $a_pc_id) |
| Get usages.
|
| getUsagesOfPage ($a_usage_id, $a_usage_type, $a_hist_nr=0, $a_all_hist_nrs=false) |
| Get page content usages for page.
|
Static Public Member Functions |
static | saveUsage ($a_pc_type, $a_pc_id, $a_usage_type, $a_usage_id, $a_usage_hist_nr=0) |
| Save usages.
|
static | deleteAllUsages ($a_pc_type, $a_usage_type, $a_usage_id, $a_usage_hist_nr=0) |
| Delete all usages.
|
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 31 of file class.ilPageContentUsage.php.
Member Function Documentation
static ilPageContentUsage::deleteAllUsages |
( |
|
$a_pc_type, |
|
|
|
$a_usage_type, |
|
|
|
$a_usage_id, |
|
|
|
$a_usage_hist_nr = 0 |
|
) |
| |
|
static |
Delete all usages.
Definition at line 52 of file class.ilPageContentUsage.php.
References $ilDB, and $q.
Referenced by ilPageObject\saveContentIncludeUsage().
{
$ilDB->manipulate(
$q =
"DELETE FROM page_pc_usage WHERE usage_type = ".
$ilDB->quote($a_usage_type, "text").
" AND usage_id = ".$ilDB->quote((int) $a_usage_id, "integer").
" AND usage_hist_nr = ".$ilDB->quote((int) $a_usage_hist_nr, "integer").
" AND pc_type = ".$ilDB->quote($a_pc_type, "text"));
}
ilPageContentUsage::getUsages |
( |
|
$a_pc_type, |
|
|
|
$a_pc_id |
|
) |
| |
Get usages.
Definition at line 66 of file class.ilPageContentUsage.php.
References $ilDB.
Referenced by ilObjMediaPoolGUI\confirmRemove().
{
$set = $ilDB->query("SELECT * FROM page_pc_usage ".
" WHERE pc_type = ".$ilDB->quote($a_pc_type, "text").
" AND pc_id = ".$ilDB->quote($a_pc_id, "integer")
);
$usages = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$usages[] = $rec;
}
return $usages;
}
ilPageContentUsage::getUsagesOfPage |
( |
|
$a_usage_id, |
|
|
|
$a_usage_type, |
|
|
|
$a_hist_nr = 0 , |
|
|
|
$a_all_hist_nrs = false |
|
) |
| |
Get page content usages for page.
- Parameters
-
Definition at line 88 of file class.ilPageContentUsage.php.
References $ilDB.
Referenced by ilObjContentObject\exportHTMLPages().
{
if (!$a_all_hist_nrs)
{
$hist_str = " AND usage_hist_nr = ".$ilDB->quote($a_hist_nr, "integer");
}
$set = $ilDB->query("SELECT pc_type, pc_id FROM page_pc_usage WHERE ".
" usage_id = ".$ilDB->quote($a_usage_id, "integer")." AND ".
" usage_type = ".$ilDB->quote($a_usage_type, "text").
$hist_str
);
$usages = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$usages[$rec["pc_type"].":".$rec["pc_id"]] = array(
"type" => $rec["pc_type"],
"id" => $rec["pc_id"]
);
}
return $usages;
}
static ilPageContentUsage::saveUsage |
( |
|
$a_pc_type, |
|
|
|
$a_pc_id, |
|
|
|
$a_usage_type, |
|
|
|
$a_usage_id, |
|
|
|
$a_usage_hist_nr = 0 |
|
) |
| |
|
static |
Save usages.
Definition at line 36 of file class.ilPageContentUsage.php.
References $ilDB.
Referenced by ilPageObject\saveContentIncludeUsage().
{
$ilDB->replace("page_pc_usage", array (
"pc_type" => array("text", $a_pc_type),
"pc_id" => array("integer", (int) $a_pc_id),
"usage_type" => array("text", $a_usage_type),
"usage_id" => array("integer", (int) $a_usage_id),
"usage_hist_nr" => array("integer", (int) $a_usage_hist_nr)
),array());
}
The documentation for this class was generated from the following file: