本文整理汇总了PHP中SLA::lookup方法的典型用法代码示例。如果您正苦于以下问题:PHP SLA::lookup方法的具体用法?PHP SLA::lookup怎么用?PHP SLA::lookup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SLA
的用法示例。
在下文中一共展示了SLA::lookup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDefaultSLA
function getDefaultSLA()
{
if (!$this->defaultSLA && $this->getDefaultSLAId()) {
$this->defaultSLA = SLA::lookup($this->getDefaultSLAId());
}
return $this->defaultSLA;
}
示例2: getSLA
function getSLA()
{
if (!$this->sla && $this->getSLAId()) {
$this->sla = SLA::lookup($this->getSLAId());
}
return $this->sla;
}
示例3: IN
case 'disable':
$sql = 'UPDATE ' . SLA_TABLE . ' SET isactive=0 ' . ' WHERE id IN (' . implode(',', db_input($_POST['ids'])) . ')';
if (db_query($sql) && ($num = db_affected_rows())) {
if ($num == $count) {
$msg = sprintf(__('Successfully disabled %s'), _N('selected SLA plan', 'selected SLA plans', $count));
} else {
$warn = sprintf(__('%1$d of %2$d %3$s disabled'), $num, $count, _N('selected SLA plan', 'selected SLA plans', $count));
}
} else {
$errors['err'] = sprintf(__('Unable to disable %s'), _N('selected SLA plan', 'selected SLA plans', $count));
}
break;
case 'delete':
$i = 0;
foreach ($_POST['ids'] as $k => $v) {
if (($p = SLA::lookup($v)) && $p->getId() != $cfg->getDefaultSLAId() && $p->delete()) {
$i++;
}
}
if ($i && $i == $count) {
$msg = sprintf(__('Successfully deleted %s'), _N('selected SLA plan', 'selected SLA plans', $count));
} elseif ($i > 0) {
$warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected SLA plan', 'selected SLA plans', $count));
} elseif (!$errors['err']) {
$errors['err'] = sprintf(__('Unable to delete %s'), _N('selected SLA plan', 'selected SLA plans', $count));
}
break;
default:
$errors['err'] = __('Unknown action - get technical help.');
}
}
示例4: sprintf
if(db_query($sql) && ($num=db_affected_rows())) {
if($num==$count)
$msg = sprintf(__('Successfully disabled %s'),
_N('selected SLA plan', 'selected SLA plans', $count));
else
$warn = sprintf(__('%1$d of %2$d %3$s disabled'), $num, $count,
_N('selected SLA plan', 'selected SLA plans', $count));
} else {
$errors['err'] = sprintf(__('Unable to disable %s'),
_N('selected SLA plan', 'selected SLA plans', $count));
}
break;
case 'delete':
$i=0;
foreach($_POST['ids'] as $k=>$v) {
if (($p=SLA::lookup($v))
&& $p->getId() != $cfg->getDefaultSLAId()
&& $p->delete())
$i++;
}
if($i && $i==$count)
$msg = sprintf(__('Successfully deleted %s'),
_N('selected SLA plan', 'selected SLA plans', $count));
elseif($i>0)
$warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count,
_N('selected SLA plan', 'selected SLA plans', $count));
elseif(!$errors['err'])
$errors['err'] = sprintf(__('Unable to delete %s'),
_N('selected SLA plan', 'selected SLA plans', $count));
break;
示例5: elseif
}
} elseif ($_POST['disable']) {
$sql = 'UPDATE ' . SLA_TABLE . ' SET isactive=0 WHERE id IN (' . implode(',', db_input($_POST['ids'])) . ')';
if (db_query($sql) && ($num = db_affected_rows())) {
if ($num == $count) {
$msg = 'Selected SLA plans disabled';
} else {
$warn = "{$num} of {$count} selected SLA plans disabled";
}
} else {
$errors['err'] = 'Unable to disable selected SLA plans';
}
} elseif ($_POST['delete']) {
$i = 0;
foreach ($_POST['ids'] as $k => $v) {
if (($p = SLA::lookup($v)) && $p->delete()) {
$i++;
}
}
if ($i && $i == $count) {
$msg = 'Selected SLA plans deleted successfully';
} elseif ($i > 0) {
$warn = "{$i} of {$count} selected SLA plans deleted";
} elseif (!$errors['err']) {
$errors['err'] = 'Unable to delete selected SLA plans';
}
} else {
$errors['err'] = 'Unknown action';
}
}
break;