本文整理汇总了PHP中CommonDBTM::addForwardEntity方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonDBTM::addForwardEntity方法的具体用法?PHP CommonDBTM::addForwardEntity怎么用?PHP CommonDBTM::addForwardEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonDBTM
的用法示例。
在下文中一共展示了CommonDBTM::addForwardEntity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerClass
/**
* Define a new class managed by a plugin
*
* @param $itemtype class name
* @param $attrib array of attributes, a hashtable with index in
* (classname, typename, reservation_types)
*
* @return bool
**/
static function registerClass($itemtype, $attrib = array())
{
global $CFG_GLPI;
$plug = isPluginItemType($itemtype);
if (!$plug) {
return false;
}
$plugin = strtolower($plug['plugin']);
if (isset($attrib['doc_types'])) {
$attrib['document_types'] = $attrib['doc_types'];
unset($attrib['doc_types']);
}
if (isset($attrib['helpdesk_types'])) {
$attrib['ticket_types'] = $attrib['helpdesk_types'];
unset($attrib['helpdesk_types']);
}
if (isset($attrib['netport_types'])) {
$attrib['networkport_types'] = $attrib['netport_types'];
unset($attrib['netport_types']);
}
foreach (array('contract_types', 'directconnect_types', 'document_types', 'helpdesk_visible_types', 'infocom_types', 'linkgroup_tech_types', 'linkgroup_types', 'linkuser_tech_types', 'linkuser_types', 'location_types', 'networkport_instantiations', 'networkport_types', 'notificationtemplates_types', 'planning_types', 'reservation_types', 'rulecollections_types', 'systeminformations_types', 'ticket_types', 'unicity_types', 'link_types') as $att) {
if (isset($attrib[$att]) && $attrib[$att]) {
array_push($CFG_GLPI[$att], $itemtype);
unset($attrib[$att]);
}
}
if (isset($attrib['device_types']) && $attrib['device_types'] && method_exists($itemtype, 'getItem_DeviceType')) {
if (class_exists($itemtype::getItem_DeviceType())) {
array_push($CFG_GLPI['device_types'], $itemtype);
}
unset($attrib[$att]);
}
if (isset($attrib['addtabon'])) {
if (!is_array($attrib['addtabon'])) {
$attrib['addtabon'] = array($attrib['addtabon']);
}
foreach ($attrib['addtabon'] as $form) {
CommonGLPI::registerStandardTab($form, $itemtype);
}
}
//Manage entity forward from a source itemtype to this itemtype
if (isset($attrib['forwardentityfrom'])) {
CommonDBTM::addForwardEntity($attrib['forwardentityfrom'], $itemtype);
}
// Use it for plugin debug
// if (count($attrib)) {
// foreach ($attrib as $key => $val) {
// Toolbox::logInFile('debug',"Attribut $key used by $itemtype no more used for plugins\n");
// }
//}
return true;
}