本文整理汇总了PHP中task::update_children方法的典型用法代码示例。如果您正苦于以下问题:PHP task::update_children方法的具体用法?PHP task::update_children怎么用?PHP task::update_children使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类task
的用法示例。
在下文中一共展示了task::update_children方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if ($_POST["mass_update"]) {
if ($_POST["select"]) {
$allowed_auto_fields = array("dateTargetStart", "dateTargetCompletion", "dateActualStart", "dateActualCompletion", "managerID", "timeLimit", "timeBest", "timeWorst", "timeExpected", "priority", "taskTypeID", "taskStatus", "personID");
foreach ($_POST["select"] as $taskID => $selected) {
$task = new task();
$task->set_id($taskID);
$task->select();
// Special case: projectID and parentTaskID have to be done together
if ($_POST["update_action"] == "projectIDAndParentTaskID") {
// Can't set self to be parent
if ($_POST["parentTaskID"] != $task->get_id()) {
$task->set_value("parentTaskID", $_POST["parentTaskID"]);
}
// If task is a parent, change the project of that tasks children
if ($_POST["projectID"] != $task->get_value("projectID") && $task->get_value("taskTypeID") == "Parent") {
$task->update_children("projectID", $_POST["projectID"]);
}
$task->set_value("projectID", $_POST["projectID"]);
$task->updateSearchIndexLater = true;
$task->save();
// All other cases are generic and can be handled by a single clause
} else {
if ($_POST["update_action"] && in_array($_POST["update_action"], $allowed_auto_fields)) {
$task->set_value($_POST["update_action"], $_POST[$_POST["update_action"]]);
$task->updateSearchIndexLater = true;
$task->save();
}
}
}
$TPL["message_good"][] = "Tasks updated.";
$url = $_POST["returnURL"] or $url = $TPL["url_alloc_taskList"];
示例2: prepare
function update_children($field, $value = "")
{
$q = prepare("SELECT * FROM task WHERE parentTaskID = %d", $this->get_id());
$db = new db_alloc();
$db->query($q);
while ($db->row()) {
$t = new task();
$t->read_db_record($db);
$t->set_value($field, $value);
$t->save();
if ($t->get_value("taskTypeID") == "Parent") {
$t->update_children($field, $value);
}
}
}