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); }
/** * Update Section * * @returns Illuminate response (JSON & HTTP code) */ public function update($id, Request $request) { return $this->pageRepository->update(new Page(), $id, $request); }
$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");
/** * Update Tag * * @returns Illuminate response (JSON & HTTP code) */ public function update($id, Request $request) { return $this->tagRepository->update(new Tag(), $id, $request); }
/** * 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')); }
/** * Update Project * * @returns Illuminate response (JSON & HTTP code) */ public function update($id, Request $request) { return $this->projectRepository->update(new Project(), $id, $request); }
/** * Update Section * * @returns Illuminate response (JSON & HTTP code) */ public function update($id, Request $request) { return $this->restfulRepository->update(new Section(), $id, $request); }
/** * * @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); }