本文整理汇总了PHP中NetworkPort::getErrorMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP NetworkPort::getErrorMessage方法的具体用法?PHP NetworkPort::getErrorMessage怎么用?PHP NetworkPort::getErrorMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetworkPort
的用法示例。
在下文中一共展示了NetworkPort::getErrorMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processMassiveActionsForOneItemtype
/**
* @since version 0.85
*
* @see CommonDBTM::processMassiveActionsForOneItemtype()
**/
static function processMassiveActionsForOneItemtype(MassiveAction $ma, CommonDBTM $item, array $ids)
{
global $DB;
switch ($ma->getAction()) {
case 'transform_to':
$input = $ma->getInput();
if (isset($input["transform_to"]) && !empty($input["transform_to"])) {
$networkport = new NetworkPort();
foreach ($ids as $id) {
if ($networkport->canEdit($id) && $item->can($id, DELETE)) {
if (empty($networkport->fields['instantiation_type'])) {
if ($networkport->switchInstantiationType($input['transform_to']) !== false) {
$instantiation = $networkport->getInstantiation();
$input2 = $item->fields;
$input2['networkports_id'] = $input2['id'];
unset($input2['id']);
if ($instantiation->add($input2)) {
$item->delete(array('id' => $id));
$ma->itemDone($item->getType(), $id, MassiveAction::ACTION_OK);
} else {
$ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO);
$ma->addMessage($networkport->getErrorMessage(ERROR_ON_ACTION));
}
} else {
$ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO);
$ma->addMessage($networkport->getErrorMessage(ERROR_ON_ACTION));
}
} else {
$ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO);
$ma->addMessage($networkport->getErrorMessage(ERROR_ON_ACTION));
}
} else {
$ma->itemDone($item->getType(), $id, MassiveAction::ACTION_NORIGHT);
$ma->addMessage($networkport->getErrorMessage(ERROR_RIGHT));
}
}
} else {
$ma->itemDone($item->getType(), $ids, MassiveAction::ACTION_KO);
}
return;
}
parent::processMassiveActionsForOneItemtype($ma, $item, $ids);
}