本文整理匯總了PHP中Notepad::cleanDBonItemDelete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Notepad::cleanDBonItemDelete方法的具體用法?PHP Notepad::cleanDBonItemDelete怎麽用?PHP Notepad::cleanDBonItemDelete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Notepad
的用法示例。
在下文中一共展示了Notepad::cleanDBonItemDelete方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: cleanRelationTable
/**
* Clean the date in the relation tables for the deleted item
* Clear N/N Relation
**/
function cleanRelationTable()
{
global $CFG_GLPI, $DB;
// If this type have INFOCOM, clean one associated to purged item
if (Infocom::canApplyOn($this)) {
$infocom = new Infocom();
if ($infocom->getFromDBforDevice($this->getType(), $this->fields['id'])) {
$infocom->delete(array('id' => $infocom->fields['id']));
}
}
// If this type have NETPORT, clean one associated to purged item
if (in_array($this->getType(), $CFG_GLPI['networkport_types'])) {
// If we don't use delete, then cleanDBonPurge() is not call and the NetworkPorts are not
// clean properly
$networkPortObject = new NetworkPort();
$networkPortObject->cleanDBonItemDelete($this->getType(), $this->getID());
// Manage networkportmigration if exists
if (TableExists('glpi_networkportmigrations')) {
$networkPortMigObject = new NetworkPortMigration();
$networkPortMigObject->cleanDBonItemDelete($this->getType(), $this->getID());
}
}
// If this type is RESERVABLE clean one associated to purged item
if (in_array($this->getType(), $CFG_GLPI['reservation_types'])) {
$rr = new ReservationItem();
if ($rr->getFromDBbyItem($this->getType(), $this->fields['id'])) {
$rr->delete(array('id' => $infocom->fields['id']));
}
}
// If this type have CONTRACT, clean one associated to purged item
if (in_array($this->getType(), $CFG_GLPI['contract_types'])) {
$ci = new Contract_Item();
$ci->cleanDBonItemDelete($this->getType(), $this->fields['id']);
}
// If this type have DOCUMENT, clean one associated to purged item
if (Document::canApplyOn($this)) {
$di = new Document_Item();
$di->cleanDBonItemDelete($this->getType(), $this->fields['id']);
}
// If this type have NOTEPAD, clean one associated to purged item
if ($this->usenotepad) {
$note = new Notepad();
$note->cleanDBonItemDelete($this->getType(), $this->fields['id']);
}
}