Update term.

@param  int $id
@param  array  $arguments

@return array|\WP_Error
515642
public function updateOrFail(Term $term)
    {
        $status = $this->update($term);

        if (is_wp_error($status)) {
            throw new QueryException("Taxonomy [{$this->slug}] could not update term.");
        }

        return $status;
    }
104190
public function update(?string $id)
    {
        $url = self::$base_url.'/'.($id ?? $this->container_id).'/update';

        $request = json_encode($request = $this->hostConfig);

        return self::$curl->post($url, $request, self::$header);
    }
31944
public function update($id, array $data)
    {
        $data = $this->resolverFactory->createExistingDeviceResolver()->resolve($data);

        return $this->api->request('PUT', '/players/'.$id, [], json_encode($data));
    }
1206795
public function update(int $id, string $name): array
    {
        return $this->httpClient->postJson('tag/update', ['tagid' => $id, 'tagname' => $name]);
    }
350566
public function updateVariations($id, $data) {
		// find
		$model = $this->get($id);

		if ($model === null) {
			return new NotFound(['message' => 'Skill not found.']);
		}

		// pass update to internal logic
		try {
			$this->doUpdateVariations($model, $data);
		} catch (ErrorsException $e) {
			return new NotValid(['errors' => $e->getErrors()]);
		}

		// save and dispatch events
		$this->dispatch(SkillEvent::PRE_VARIATIONS_UPDATE, $model, $data);
		$this->dispatch(SkillEvent::PRE_SAVE, $model, $data);
		$rows = $model->save();
		$this->dispatch(SkillEvent::POST_VARIATIONS_UPDATE, $model, $data);
		$this->dispatch(SkillEvent::POST_SAVE, $model, $data);

		if ($rows > 0) {
			return Updated(['model' => $model]);
		}

		return NotUpdated(['model' => $model]);
	}
898207
private function update($id, $data)
    {
        foreach ($data as $key => $value) {
            $fields[] = $key . ' = ?';
        }
        $query = 'UPDATE ' . self::DIAGNOSTIC_TABLE . ' SET ' . implode(', ', $fields) .
                 ' WHERE ' . self::DIAGNOSTIC_ID . ' = ?';
        return $this->persistence->exec($query, array_merge(array_values($data), array($id)));
    }
1137270
public function update($id, $data)
    {
        $modelName = $this->modelFullName;
        if($this->validate($data, $modelName::$rules))
        {
            $model = $modelName::find($id);
            if(!$model) throw new NotFoundException('There is no Resource with id = ' . $id . ' !');
            $model->update($data);
            return $model;
        }
    }
365257
public function updateAction($id) {
        $entity = $this->container->get("haven_core.category.read_handler")->getOne($id);
        $delete_form = $this->container->get("haven_core.category.form_handler")->createDeleteForm($id);
        $edit_form = $this->container->get("haven_core.category.form_handler")->createEditForm($id);

        $request = $this->container->get('request_modifier')->setRequest($this->container->get("request"))
                ->slug(array("name"))
                ->getRequest();

        $edit_form->bind($request);
        if ($edit_form->isValid()) {
            $this->container->get("haven_core.category.persistence_handler")->save($edit_form->getData());

            $this->container->get("session")->getFlashBag()->add("success", "update.success");
            return new RedirectResponse($this->container->get('router')->generate(str_replace('update', "edit", $this->container->get("request")->get("_route")), array("id" => $entity->getId())));
        }

        $this->container->get("session")->getFlashBag()->add("error", "update.error");

        $template = str_replace(":update.html.twig", ":edit.html.twig", $this->container->get("request")->get('_template'));
        $params = array(
            'entity' => $entity,
            'edit_form' => $edit_form->createView(),
            'delete_form' => $delete_form->createView(),
        );

        return new Response($this->container->get('templating')->render($template, $params));
    }
1260143
public function delete($id, $args = [])
    {
        $result = wp_delete_term($id, $args['taxonomy']);

        if (is_wordpress_error($result)) {
            throw new UnexpectedValueException(
                sprintf('[W611] Failed deleting a term: %s', $result->get_error_message())
            );
        }
    }
1324381
public function update($id, array $fields)
    {
        $xml = "<employee>";

        foreach ($fields as $field => $value) {
            $xml .= "<field id=\"{$field}\">{$value}</field>";
        }

        $xml .= "</employee>";

        return $this->post("employees/{$id}", $xml);
    }
849171
protected function prepareArguments(/*# string */ $id, array $arguments)
    {
        $args  = isset($arguments[1]) ? (array) $arguments[1] : [];
        $scope = isset($arguments[2]) ? (string) $arguments[2] :
            $this->getScope($id);

        // scope === '@serviceId@' ?
        if (isset($this->circular[$scope])) {
            $scope .= '#' . $this->circular[$scope];
        }

        return [ $args, $scope, $scope . '::' . $id ];
    }
168519
public function getUpdateUrl($id, array $parameters = [])
    {
        array_unshift($parameters, $this->getAlias(), $id);

        return route('admin.model.update', $parameters);
    }
1171899
public function update($id, $data)
    {

        $model = $this->findRecord($id);

        $model->update($data);

        return $model;

    }
338397
public function update($id, array $data)
    {
        $todolist = $this->client->put(
            sprintf('buckets/%d/todolists/%d.json', $this->bucket, $id),
            [
                'json' => $data,
            ]
        );

        return new TodoList($this->response($todolist));
    }
966039
protected function _update( $args, $assoc_args, $callback ) {
		$status = 0;

		if ( empty( $assoc_args ) ) {
			WP_CLI::error( 'Need some fields to update.' );
		}

		if ( Utils\get_flag_value( $assoc_args, 'defer-term-counting' ) ) {
			wp_defer_term_counting( true );
		}

		foreach ( $args as $obj_id ) {
			$params = array_merge( $assoc_args, [ $this->obj_id_key => $obj_id ] );

			$status = $this->success_or_failure(
				$this->wp_error_to_resp(
					$callback( $params ),
					"Updated {$this->obj_type} {$obj_id}."
				)
			);
		}

		if ( Utils\get_flag_value( $assoc_args, 'defer-term-counting' ) ) {
			wp_defer_term_counting( false );
		}

		exit( $status );
	}
722273
public function update($id)
    {

        $model = ModuleRow::withoutGlobalScopes()->findOrFail($id);
        if (!request()->isMethod('put')) {
            $form = $this->form($model);
        } else {
            $input = Input::all();
            $user  = auth()->user();

            if (!$user->hasRoles('member')) {
                $model->user_id = array_get($input, 'user');
            }
            $model->name  = array_get($input, 'name');
            $model->value = array_only($input, ['field_1', 'field_2']);
            $form         = $this->form($model);

            if (!$form->isValid()) {
                return redirect_with_errors(handles('antares::sample_module/index/' . $id . '/edit'), $form->getMessageBag());
            }

            if (!$model->save()) {
                event('notifications.item_has_not_been_updated', ['variables' => ['user' => user(), 'item' => $model]]);
                return redirect_with_message(handles('antares::sample_module/index'), trans('antares/sample_module::messages.update_error'), 'error');
            }
            event('notifications.item_has_been_updated', ['variables' => ['user' => user(), 'item' => $model]]);

            return redirect_with_message(handles('antares::sample_module/index'), trans('antares/sample_module::messages.update_success'), 'success');
        }

        return view('antares/sample_module::admin.module.create', ['form' => $form]);
    }
1333554
public function update($id, array $fields = [], $script = null, array $params = [])
    {
        $body = array_filter(
            [
                'doc' => $fields,
                'script' => $script,
            ]
        );

        $params = array_merge(
            [
                'id' => $id,
                'index' => $this->getManager()->getIndexName(),
                'type' => $this->type,
                'body' => $body,
            ],
            $params
        );

        return $this->getManager()->getClient()->update($params);
    }