本文整理汇总了PHP中NetworkPort::cleanDBonItemDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP NetworkPort::cleanDBonItemDelete方法的具体用法?PHP NetworkPort::cleanDBonItemDelete怎么用?PHP NetworkPort::cleanDBonItemDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetworkPort
的用法示例。
在下文中一共展示了NetworkPort::cleanDBonItemDelete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cleanDBonPurge
function cleanDBonPurge()
{
$networkPort = new NetworkPort();
$networkPort->cleanDBonItemDelete($this->getType(), $this->fields['id']);
}
示例2: 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']);
}
}