本文整理汇总了PHP中Repository::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::update方法的具体用法?PHP Repository::update怎么用?PHP Repository::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Repository
的用法示例。
在下文中一共展示了Repository::update方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUpdateSkipsRelations
public function testUpdateSkipsRelations()
{
$homer = $this->repository->findOneBy('name', 'Homer');
$homer->children = (object) ['pid' => 1, 'name' => 'Bart'];
$homer->name = 'Foo';
// Expect no exceptions.
$this->repository->update($homer);
}
示例2: update
/**
* Update Section
*
* @returns Illuminate response (JSON & HTTP code)
*/
public function update($id, Request $request)
{
return $this->pageRepository->update(new Page(), $id, $request);
}
示例3: _
$error = true;
}
if ($doctext == "") {
$info_error[] = _("Error in the 'text' field (missing required field)");
$error = true;
}
if ($error == false) {
$parser = new KDB_Parser();
$parser->proccess_file($doctext, $id_document);
$info_error = $parser->is_valid();
if (count($info_error) > 0) {
$error = true;
}
}
if ($error == false) {
Repository::update($conn, $id_document, $title, $doctext, $keywords);
}
}
$sintax = new KDB_Sintax();
$labels_condition = $sintax->_labels_condition;
$labels_actions = $sintax->_labels_actions;
$labels_operators = $sintax->_labels_operators;
$labels_variables = $sintax->_labels_variables;
$help_msgs = array();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> <?php
echo gettext("OSSIM Framework");
示例4: update
/**
* Update Tag
*
* @returns Illuminate response (JSON & HTTP code)
*/
public function update($id, Request $request)
{
return $this->tagRepository->update(new Tag(), $id, $request);
}
示例5: update
/**
* Update a repository
*
* @param null
* @return void
*/
function update()
{
if (!$this->active_repository->canEdit($this->logged_user)) {
$this->httpError(HTTP_ERR_FORBIDDEN);
}
// if
$last_commit = $this->active_repository->getLastCommit();
$revision_to = !instance_of($last_commit, 'Commit') ? 1 : $last_commit->getRevision() + 1;
$latest_revision = !instance_of($last_commit, 'Commit') ? 0 : $last_commit->getRevision();
$head_revision = $this->repository_engine->getHeadRevision($this->request->isAsyncCall());
$bulk_update = array_var($_GET, 'bulk') == '1';
$uptodate = intval($head_revision == $latest_revision);
// simple mass update
if ($this->request->isAsyncCall() == false && $bulk_update) {
if (is_null($this->repository_engine->error)) {
$logs = $this->repository_engine->getLogs($revision_to);
// Loop through array of logs and prepare data for inserting into project_objects table
if (is_foreachable($logs['data'])) {
$this->active_repository->update($logs['data']);
}
// if
if ($logs['total'] > 0) {
$this->active_repository->sendToSubscribers($logs['total'], $this->repository_engine);
$this->active_repository->createActivityLog($logs['total']);
flash_success(lang('Update successfully performed with :total_commits new history entries added.'), array('total_commits' => $logs['total']));
} else {
flash_success(lang('Repository is already up-to-date'));
}
// if
} else {
flash_error($this->repository_engine->error);
}
// if
$this->redirectToReferer(source_module_url($this->active_project));
} elseif ($this->request->isAsyncCall()) {
if (!is_null($this->repository_engine->error)) {
die($this->repository_engine->error);
}
// if
if (array_var($_GET, 'notify')) {
$total_commits = $notify_subscribers;
$this->active_repository->sendToSubscribers($total_commits, $this->repository_engine);
$this->active_repository->createActivityLog($total_commits);
die('success');
}
// if
$difference = $head_revision - $latest_revision;
$more_logs = true;
if ($difference > SOURCE_MODULE_LOGS_PER_REQUEST) {
$revision_from = $revision_to + SOURCE_MODULE_LOGS_PER_REQUEST - 1;
} else {
$revision_from = $head_revision;
$more_logs = false;
}
// if
$log = $this->repository_engine->getLogs($revision_to, $revision_from);
if (is_null($this->repository_engine->error)) {
$this->active_repository->update($log['data']);
die($more_logs || $log['total'] > 0 ? 'success' : 'finished');
} else {
die($this->repository_engine->error);
}
// if
}
$this->smarty->assign(array('uptodate' => $uptodate, 'head_revision' => $head_revision, 'last_revision' => $latest_revision, 'repository_update_url' => str_replace('/', '\\/', $this->active_repository->getUpdateUrl()), 'indicator_ok' => ASSETS_URL . '/images/ok_indicator.gif'));
}
示例6: update
/**
* Update Project
*
* @returns Illuminate response (JSON & HTTP code)
*/
public function update($id, Request $request)
{
return $this->projectRepository->update(new Project(), $id, $request);
}
示例7: update
/**
* Update Section
*
* @returns Illuminate response (JSON & HTTP code)
*/
public function update($id, Request $request)
{
return $this->restfulRepository->update(new Section(), $id, $request);
}
示例8: update
/**
*
* @param string $givenParameters
* @param string $login
*/
public static function update($givenParameters, $origin = "form", $route = "", $validate = true, $validateMandatory = true)
{
/* Do not perform update if password is empty */
if (isset($givenParameters['password']) && $givenParameters['password'] == '') {
unset($givenParameters['password']);
} elseif (isset($givenParameters['password'])) {
$givenParameters['password2'] = self::generateHashedPassword($givenParameters);
}
if (isset($givenParameters['login']) && !is_null($givenParameters['login']) && !isset($givenParameters['object_id'])) {
$user = User::getIdByParameter('login', array($givenParameters['login']));
if (is_array($user) && count($user) > 0) {
$givenParameters['object_id'] = $user[0];
}
}
$currentDate = date('Y-m-d H:i:s');
$givenParameters['updatedat'] = $currentDate;
parent::update($givenParameters, $origin, $route, $validate, $validateMandatory);
}