本文整理汇总了PHP中kernel::update方法的典型用法代码示例。如果您正苦于以下问题:PHP kernel::update方法的具体用法?PHP kernel::update怎么用?PHP kernel::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kernel
的用法示例。
在下文中一共展示了kernel::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
function edit()
{
$response = $this->get_response();
$form = $response->form;
if (!$form->get_errors() && $response->submit()) {
$errors = array();
$message = array();
$kernel_id = $this->response->html->request()->get($this->identifier_name);
$kernel_comment = $this->response->html->request()->get('kernel_comment');
$kernel = new kernel();
$kernel->get_instance_by_id($kernel_id);
$kernel_comment = $response->html->request()->get('kernel_comment');
$fields['kernel_comment'] = htmlspecialchars($kernel_comment);
$kernel->update($kernel_id, $fields);
$response->msg = sprintf($this->lang['msg'], $kernel->name);
}
return $response;
}
示例2: kernel
// check that name is unique
$kernel->get_instance_by_name($kernel_name);
if ($kernel->id > 0) {
$event->log("{$kernel_command}", $_SERVER['REQUEST_TIME'], 5, "kernel-action", "Kernel name must be unique! Not adding new kernel " . $kernel_name, "", "", 0, 0, 0);
} else {
if ($kernel_name == 'default') {
$kernel_fields["kernel_id"] = 1;
} else {
$kernel_fields["kernel_id"] = (int) str_replace(".", "", str_pad(microtime(true), 15, "0"));
}
$kernel->add($kernel_fields);
}
break;
case 'update':
$kernel = new kernel();
$kernel->update($kernel_id, $kernel_fields);
break;
case 'remove':
$kernel = new kernel();
$kernel->remove($kernel_id);
break;
case 'remove_by_name':
$kernel = new kernel();
$kernel->remove_by_name($kernel_name);
break;
default:
$event->log("{$kernel_command}", $_SERVER['REQUEST_TIME'], 3, "kernel-action", "No such kernel command ({$kernel_command})", "", "", 0, 0, 0);
break;
}
?>