Updates the DNS record.

@param integer $id
@param integer $hdomain_id
@throws BadRequestHttpException
@throws NotFoundHttpException
@return string
486301
public function actionUpdate($id = null, $hdomain_id = null)
    {
        if ($id && $hdomain_id && $model = $this->newModel()->findOne(compact('id', 'hdomain_id'))) {
            $model->scenario = 'update';

            return $this->renderAjax('update', ['model' => $model]);
        }

        $collection = (new Collection([
            'model' => $this->newModel(['scenario' => 'update']),
        ]))->load();

        if ($collection->first->id && $collection->save()) {
            Yii::$app->session->addFlash('success', Yii::t('hipanel:dns', '{0, plural, one{DNS record} other{# DNS records}} updated successfully', $collection->count()));

            return $this->renderZoneView($collection->first->hdomain_id);
        }
        throw new BadRequestHttpException('Bad request');
    }
1142267
public function update(HCResourceRequest $request, string $id): JsonResponse
    {
        /** @var HCResource $record */
        $record = $this->service->getRepository()->findOneBy(['id' => $id]);
        $record->update($request->getRecordData());
        $record->updateTranslations($request->getTranslations());
        $record->tags()->sync($request->getTags($this->resourceTagService->getRepository()));

        if ($record) {
            $record = $this->service->getRepository()->find($id);

            event(new HCResourceUpdated($record));
        }

        return $this->response->success('Updated', $record);
    }
1301325
protected function __apiUpdate (string $id)
    {
        $record = HCPagesCategories::findOrFail($id);

        $data = $this->getInputData();

        $record->update(array_get($data, 'record'));
        $record->updateTranslations(array_get($data, 'translations'));

        return $this->apiShow($record->id);
    }
162644
public function update($id, array &$doc)
    {
        $json = JSONEncoder::encode($doc);

        $response = $this->client->request('PUT', "/{$this->name}/{$id}", [
            'body'    => $json,
            'headers' => ['Content-Type' => 'application/json'],
        ]);

        if (201 !== $response->getStatusCode()) {
            throw new Exception('Unable to save document');
        }

        $value = JSONEncoder::decode((string) $response->getBody());

        $doc['_id'] = $value['id'];
        $doc['_rev'] = $value['rev'];
    }
29415
protected function updateAddress($id = null)
    {
        $request = $this->getCurrentRequest();
        $customer = $this->getCustomer();

        // Show address creation/edition form
        if (null === $id) {
            $form = $this->createForm(AddressType::class);
        } else {
            $address = $this->getAddressManager()->findOneBy(['id' => $id]);
            $this->checkAddress($address);

            $form = $this->createForm(AddressType::class, $address, [
                'context' => $request->query->get('context'),
            ]);
        }

        $template = 'SonataCustomerBundle:Addresses:new.html.twig';

        if ('POST' === $request->getMethod()) {
            $form->handleRequest($request);

            if ($form->isValid()) {
                $address = $form->getData();

                $customer->addAddress($address);

                $this->getCustomerManager()->save($customer);

                $this->get('session')->getFlashBag()->add('sonata_customer_success', $id ? 'address_edit_success' : 'address_add_success');

                $url = $this->get('session')->get('sonata_address_redirect', $this->generateUrl('sonata_customer_addresses'));

                return new RedirectResponse($url);
            }
        }

        return $this->render($template, [
            'form' => $form->createView(),
            'breadcrumb_context' => 'customer_address',
        ]);
    }
936530
public function update($id)
    {
        $data = Input::all();

        $isEditable = $this->isEditable($data);

        $data = $this->handleEditable($data);

        $data = $this->handleFileDelete($data);

        if ($this->handleOrderable($id, $data)) {
            return response([
                'status'  => true,
                'message' => trans('admin.update_succeeded'),
            ]);
        }

        /* @var Model $this->model */
        $this->model = $this->model->with($this->getRelations())->findOrFail($id);

        $this->setFieldOriginalValue();

        // Handle validation errors.
        if ($validationMessages = $this->validationMessages($data)) {
            if (!$isEditable) {
                //$name = str_replace('update','edit',\Route::currentRouteName());
                //return redirect()->route($name, [explode('.', $name)[0] => $id])->withInput()->withErrors($validationMessages);
                return back()->withInput()->withErrors($validationMessages);
            } else {
                return response()->json(['errors' => array_dot($validationMessages->getMessages())], 422);
            }
        }

        if (($response = $this->prepare($data)) instanceof Response) {
            return $response;
        }

        DB::transaction(function () {
            $updates = $this->prepareUpdate($this->updates);

            foreach ($updates as $column => $value) {
                /* @var Model $this->model */
                $this->model->setAttribute($column, $value);
            }

            $this->model->save();

            $this->updateRelation($this->relations);
        });

        if (($result = $this->complete($this->saved)) instanceof Response) {
            return $result;
        }

        if ($response = $this->ajaxResponse(trans('admin.update_succeeded'))) {
            return $response;
        }

        return $this->redirectAfterUpdate();
    }
762614
public function update($id)
    {
        try
        {
            $credentials = Input::except('groups');
            $credentials['groups'] = Input::get('groups', array());
            $credentials['id'] = $id;


            if( $this->userForm->update($credentials) )
            {
                return Redirect::route('cpanel.users.index')
                    ->with('success', Lang::get('cpanel::users.update_success'));
            }

            return Redirect::back()
                ->withInput()
                ->withErrors($this->userForm->getErrors());
        }
        catch ( UserNotFoundException $e)
        {
            return Redirect::route('cpanel.users.index')
                    ->with('error', $e->getMessage());
        }
    }
787880
public function updateDetails(string $id, array $data, array $headers = [])
    {
        $url = $this->url('invoices/%s/update_details', $id);

        return $this->post($url, $data, $headers);
    }
50843
public function edit($id): Response
    {
        if ($objectInfo = $this->model->findFirst($id)) {
            $request = $this->request->getPut();

            if (empty($request)) {
                $request = $this->request->getJsonRawBody(true);
            }
            //update
            if ($objectInfo->update($request, $this->updateFields)) {
                return $this->response($objectInfo->toArray());
            } else {
                //didnt work
                throw new Exception($objectInfo->getMessages()[0]);
            }
        } else {
            throw new Exception('Record not found');
        }
    }
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);
    }
539522
public function update(string $id, array $data, array $headers = [])
    {
        $url = $this->url('coupon_sets/%s/update', $id);

        return $this->post($url, $data, $headers);
    }
1215606
public static function updateId($id, $data, $params=[], $filter=false) {
        return static::dao()->updateId($id, $data, $params, $filter);
    }
1117404
def update_dns(self, new_ip):
        

        headers = None
        if self.auth_type == 'T':
            api_call_url = self._base_url.format(hostname=self.hostname,
                                                 token=self.auth.token,
                                                 ip=new_ip)
        else:
            api_call_url = self._base_url.format(hostname=self.hostname,
                                                 ip=new_ip)
            headers = {
                'Authorization': "Basic %s" %
                                 self.auth.base64key.decode('utf-8'),
                'User-Agent': "%s/%s %s" % (__title__, __version__, __email__)
            }

        r = requests.get(api_call_url, headers=headers)
        self.last_ddns_response = str(r.text).strip()

        return r.status_code, r.text
676135
public function update(AddressBookRequest $request, int $id)
    {
        try {
            $address = Auth::user()->findAddress($id);
        } catch(\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
            return $this->respondsWithError(trans('address.errors.model_not_found'));
        }

        $address->update($request->all());

        return $this->respondsWithSuccess(trans('address.success_update'), route('addressBook.index'));
    }
90208
public function update($id) {
		$rules    = [];
		$nicename = [];
		foreach (\L::all() as $l) {
			$nicename['name_'.$l] = trans('admin.name_'.$l);
			$rules['name_'.$l]    = 'required';
		}
		$this->validate(request(), $rules, [], $nicename);
		session()->flash('success', trans('admin.updated'));
		$data = request()->except(['_token', '_method', 'parent']);
		if (request()->input('parent') != null) {
			$data['parent'] = request('parent');
		} else {
			$data['parent'] = null;
		}
		$data['admin_id'] = admin()->user()->id;

		if (request()->hasFile('icon')) {
			$dep = Dep::find($id);
			!empty($dep->icon)?Up::del_icon($dep->icon):'';// Delete Icon If Has File
			$data['icon'] = it()->upload(request()->file('icon'), 'departments/'.time(), 'icon');
		}

		if (request()->has('color')) {
			$data['color'] = request('color');
		}

		Dep::where('id', $id)->update($data);
		return back();
	}
604221
public function update(int $id, Request $request)
    {
        $attachment = Attachment::findOrFail($id)
            ->fill($request->all());

        $attachment->save();

        return response()->json($attachment);
    }
373971
private void updateDomain(Long domainId, String name, String authorityType, String ttl, boolean reverse) throws GloboDnsException {
		if (domainId == null) {
			throw new GloboDnsException("Domain id cannot be null");
		}
		
		Domain domain = new Domain();
		if (name != null)
			domain.getDomainAttributes().setName(name);
		if (authorityType != null)
			domain.getDomainAttributes().setAuthorityType(authorityType);
		if (ttl != null)
			domain.getDomainAttributes().setTTL(ttl);
		
		GloboDnsRoot<Domain> globoDnsRoot = this.put("/domains/" + domainId + ".json" + (reverse ? "?reverse=true" : ""), domain, false);
		if (globoDnsRoot == null) {
			throw new GloboDnsException("Invalid response");
		}
		return;
	}