本文整理汇总了PHP中Team::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Team::update方法的具体用法?PHP Team::update怎么用?PHP Team::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Team
的用法示例。
在下文中一共展示了Team::update方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
public static function update($id)
{
$params = $_POST;
$attributes = array('id' => $id, 'name' => $params['name'], 'year' => $params['year'], 'city' => $params['city']);
$Team = new Team($attributes);
$errors = $Team->errors();
if (count($errors) != 0) {
View::make('/Team/edit.html', array('errors' => $errors, 'attributes' => $attributes));
} else {
$Team->update();
Redirect::to('/team/' . $Team->id, array('message' => 'Joukkuetta on muokattu onnistuneesti!'));
}
}
示例2: _ops_update
function _ops_update()
{
$OID = max(0, intval($_POST['OID']));
$CID = max(0, intval($_POST['CID']));
$msg = "";
loginRequireMgmt();
if (!loginCheckPermission(USER::MGMT_TEAM)) {
redirect("errors/401");
}
$itemName = "Team";
$urlPrefix = "mgmt_team";
$object = new Team();
if ($OID) {
$object->retrieve($OID, $CID);
if (!$object->exists()) {
$msg = "{$itemName} not found!";
} else {
transactionBegin();
$object->merge($_POST);
if ($object->update()) {
transactionCommit();
$msg = "{$itemName} updated!";
} else {
transactionRollback();
$msg = "{$itemName} update failed";
}
}
} else {
$object->merge($_POST);
for ($retry = 0; $retry < PIN_RETRY_MAX; $retry++) {
$pin = Team::generatePIN();
if (Team::getFromPin($pin) === false) {
// not a duplicate
$object->set('pin', $pin);
transactionBegin();
if ($object->create() !== false) {
transactionCommit();
$msg = "{$itemName} created!";
break;
}
}
}
if ($retry >= PIN_RETRY_MAX) {
transactionRollback();
$msg = "{$itemName} Create failed";
}
}
redirect("{$urlPrefix}/manage", $msg);
}
示例3: Team
echo $rs["id_project"];
?>
', '#app_pane_body');
}, 100);
window.parent.boss.popup("Error ao deletar equipe.");
</script>
<?php
}
} else {
$model = new Team();
$sql = array('id_team' => $pk, 'status' => '1');
$fields = array("id_project");
$rs = $model->get($sql);
$rs = $rs[0];
$model->fields = array('name' => $name, 'website' => $website, 'slug' => $slug);
$update = $model->update($sql);
if ($update) {
?>
<script>
var timePopup = setTimeout(function(){
window.parent.boss.removeClass('modal_dialog', 'active');
window.parent.boss.ajax.load('/app/team/view_team/?pk=<?php
echo $rs["id_project"];
?>
', '#app_pane_body');
}, 100);
window.parent.boss.popup("Sucesso ao editar equipe.");
</script>
<?php
} else {
?>
示例4: catch
$origteam->fetchdets();
} catch (TeamException $e) {
$mess = $e->getMessage();
include 'php/wrongentry.php';
exit(0);
}
// Check name changes
$newteam = new Team($teamname);
if (!$origteam->is_same($newteam)) {
checkname($newteam);
$origteam->updatename($newteam);
}
$origteam->Description = $teamdescr;
$origteam->Division = $teamdiv;
$origteam->Captain = new Player($captfirst, $captlast);
$origteam->update();
$Title = "Team {$origteam->display_name()} updated OK";
break;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<?php
$Title = "Team update complete";
include 'php/head.php';
?>
<body>
<script language="javascript" src="webfn.js"></script>
<?php
$showadmmenu = true;
include 'php/nav.php';
示例5: connectToEncryptedMySQL
<?php
require_once "/etc/apache2/capstone-mysql/encrypted-config.php";
require_once "your-class-file.php";
$pdo = connectToEncryptedMySQL("/etc/apache2/data-design/dfontaine1.ini");
// now procede to PDO normally
$team = new Team(null, 1, "this is from PHP");
$team->insert($pdo);
$team->setTeamContent("now I change the message");
$team->update($pdo);
$team->delete($pdo);