本文整理匯總了PHP中CommonDBChild::post_purgeItem方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonDBChild::post_purgeItem方法的具體用法?PHP CommonDBChild::post_purgeItem怎麽用?PHP CommonDBChild::post_purgeItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonDBChild
的用法示例。
在下文中一共展示了CommonDBChild::post_purgeItem方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
function post_purgeItem()
{
$this->cleanDatabase();
parent::post_purgeItem();
}
示例2: Ticket
function post_purgeItem()
{
global $DB;
parent::post_purgeItem();
$ticket = new Ticket();
$itemtype_id = $ticket->getSearchOptionIDByField('field', 'itemtype', 'glpi_tickets');
$items_id_id = $ticket->getSearchOptionIDByField('field', 'items_id', 'glpi_tickets');
// Try to delete itemtype -> delete items_id
if ($this->fields['num'] == $itemtype_id) {
$query = "SELECT `id`\n FROM `" . $this->getTable() . "`\n WHERE `" . static::$items_id . "` = '" . $this->fields['tickettemplates_id'] . "'\n AND `num` = '{$items_id_id}'";
if ($result = $DB->query($query)) {
if ($DB->numrows($result)) {
$a = new self();
$a->delete(array('id' => $DB->result($result, 0, 0)));
}
}
}
}
示例3:
/**
* @since version 0.84
*
* @see CommonDBTM::post_purgeItem()
**/
function post_purgeItem()
{
parent::post_purgeItem();
if (isset($this->fields['rules_id']) && ($realrule = Rule::getRuleObjectByID($this->fields['rules_id']))) {
$realrule->update(array('id' => $this->fields['rules_id'], 'date_mod' => $_SESSION['glpi_currenttime']));
}
}