本文整理汇总了PHP中Subject::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP Subject::insert方法的具体用法?PHP Subject::insert怎么用?PHP Subject::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subject
的用法示例。
在下文中一共展示了Subject::insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertSubject
public function insertSubject($subject)
{
if (is_null($subject['mean'])) {
$subject['mean'] = '';
}
$subject['time_date'] = '';
return Subject::insert($subject);
}
示例2: showSubject
function showSubject()
{
global $connector;
$subject = new Subject();
$subject->setConnector($connector);
if (isset($_POST['operation'])) {
list($operation, $params) = explode("#", $_POST['operation']);
switch ($operation) {
case 'saveChanges':
$subject->storeFormValues($_POST);
$error_msg = $subject->insert();
if ($error_msg) {
$result['edit'] = $subject;
}
break;
case 'delete':
$error_msg = $subject->delete($params);
break;
case 'edit':
$result['edit'] = $subject->getById($params);
break;
case 'editChanges':
$subject->storeFormValues($_POST);
$error_msg = $subject->update();
break;
default:
$error_msg = "Operazione non valida";
}
if ($error_msg != "") {
$result["errorMessage"] = $error_msg;
} elseif ($operation != 'edit') {
$result["statusMessage"] = "Operazione completata!";
}
}
if (isset($_POST['search'])) {
$result["subjects"] = $subject->search($_POST['search']);
} else {
$result["subjects"] = $subject->getList();
}
$page = "subject.php";
include_once BASE_PATH . "template.php";
}