本文整理汇总了PHP中Computer_Item::doSpecificMassiveActions方法的典型用法代码示例。如果您正苦于以下问题:PHP Computer_Item::doSpecificMassiveActions方法的具体用法?PHP Computer_Item::doSpecificMassiveActions怎么用?PHP Computer_Item::doSpecificMassiveActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Computer_Item
的用法示例。
在下文中一共展示了Computer_Item::doSpecificMassiveActions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doSpecificMassiveActions
/**
* @see CommonDBTM::doSpecificMassiveActions()
**/
function doSpecificMassiveActions($input = array())
{
$res = array('ok' => 0, 'ko' => 0, 'noright' => 0);
switch ($input['action']) {
case "connect":
case "disconnect":
$ci = new Computer_Item();
return $ci->doSpecificMassiveActions($input);
default:
return parent::doSpecificMassiveActions($input);
}
return $res;
}
示例2: doSpecificMassiveActions
/**
* @see CommonDBTM::doSpecificMassiveActions()
**/
function doSpecificMassiveActions($input = array())
{
$res = array('ok' => 0, 'ko' => 0, 'noright' => 0);
switch ($input['action']) {
case "connect":
$ci = new Computer_Item();
return $ci->doSpecificMassiveActions($input);
case "install":
if (isset($input['softwareversions_id']) && $input['softwareversions_id'] > 0) {
$inst = new Computer_SoftwareVersion();
foreach ($input['item'] as $key => $val) {
if ($val == 1) {
$input2 = array('computers_id' => $key, 'softwareversions_id' => $input['softwareversions_id']);
if ($inst->can(-1, 'w', $input2)) {
if ($inst->add($input2)) {
$res['ok']++;
} else {
$res['ko']++;
}
} else {
$res['noright']++;
}
}
}
} else {
$res['ko']++;
}
break;
default:
return parent::doSpecificMassiveActions($input);
}
return $res;
}