Update a project.

@param  int    $id
@param  array  $data
@return \Illuminate\Support\Collection
194127
public function update($id, array $data)
    {
        $project = $this->client->put(sprintf('projects/%d.json', $id), [
            'json' => $data,
        ]);

        return new Project($this->response($project));
    }
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;
        }
    }
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));
    }
712387
public function update($id, array $data) : bool
    {
        if ($record = $this->find($id)) {
            $data = $this->preUpdate($this->parseData($data), $id, $record);
            return $this->postUpdate($data, $id, $record->update($data), $record);
        } else {
            $this->throwModelNotFoundException($id);
        }
    }
191228
public function update($id, array $data)
    {
        $chatbot = $this->client->put(
            sprintf('buckets/%d/chats/%d/integrations/%d.json', $this->bucket, $this->parent, $id),
            [
                'json' => $data
            ]
        );
        $chatbot = new Chatbot($this->response($chatbot));
        $chatbot->inContext($this->bucket, $this->parent);

        return $chatbot;
    }
1360719
public function update($id, $data)
    {
        $siteId = $this->getRequestSiteId();

        //ACCESS CHECK
        $sitePagesResource = $this->getSitePagesResourceId($siteId);
        if (!$this->isAllowed('pages', 'edit')
            && !$this->isAllowed(
                $sitePagesResource,
                'edit'
            )
        ) {
            $this->getResponse()->setStatusCode(Response::STATUS_CODE_401);

            return $this->getResponse();
        }

        $inputFilter = new SitePageUpdateInputFilter();

        $inputFilter->setData($data);

        if (!$inputFilter->isValid()) {
            return new ApiJsonModel(
                [],
                1,
                'Some values are missing or invalid for page update.',
                $inputFilter->getMessages()
            );
        }

        $data = $inputFilter->getValues();

        // <tracking>
        $data['modifiedByUserId'] = $this->getCurrentUserId();
        $data['modifiedReason'] = 'Update site in ' . get_class($this);

        $site = $this->getSite($siteId);

        if (empty($site)) {
            return new ApiJsonModel(
                null,
                1,
                "Site was not found with id {$siteId}."
            );
        }

        $page = $this->getPage($site, $id);

        $this->pageMutationService->updatePublishedVersionOfPage($this->getCurrentUser(), $page, $data);

        $apiResponse = new SitePageApiResponse($page);

        return new ApiJsonModel($apiResponse, 0, 'Success: Page updated.');
    }
539522
public function update(string $id, array $data, array $headers = [])
    {
        $url = $this->url('coupon_sets/%s/update', $id);

        return $this->post($url, $data, $headers);
    }
1265910
public function update($id, array $data): bool
    {
        // 检查是否已经修改了pid
        $cate = $this->repo->find($id);
        $bool = DB::transaction(function () use ($id, $data, $cate) {
            if (!is_null($cate) && $cate->pid != $data['pid']) { //处理所有子分类的path
                // 获取所有子分类
                $this->repo->makeModel();

                $children = $this->getChildren($id, true);

                // 获取pid对应的模型
                $this->repo->makeModel();

                $this->repo = $this->setRepository();
                $parent = $this->repo->find($data['pid']);

                // 处理每一个子分类
                $children->each(function ($item) use ($parent, $cate) {
                    if (! is_null($parent)) {
                        $item->root_id = $parent->root_id;
                        // 在自己的path前面加上parent的path
                        $path = rtrim($parent->path, ",");
                        $item->path = $path . $item->path;
                        $item->deep = count(explode(',', $item->path)) - 3;
                    } else {
                        // 截断path
                        $item->path = substr($item->path, strpos($item->path, ",{$cate->id},") - strlen($item->path));

                        // 计算deep
                        $item->deep = count(explode(',', $item->path)) - 3;
                        // 重置root_id
                        $item->root_id = $cate->id;
                    }

                    $item->save();
                });
            }

            $bool = $this->repo->update($id, $data);
            if (false === $bool) {
                throw new CommodityCateException('商品分类没有修改成功', ExceptionCode::UPDATED_FAILURE);
            }

            event(new ShopCateEvent($id, 'updated'));

            return $bool;
        });

        return $bool;
    }
608600
public function update($id, $data) {
		// find
		$model = $this->get($id);

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

		// hydrate
		$serializer = Object::getSerializer();
		$model = $serializer->hydrate($model, $data);
		$this->hydrateRelationships($model, $data);

		// dispatch pre save hooks
		$this->dispatch(ObjectEvent::PRE_UPDATE, $model, $data);
		$this->dispatch(ObjectEvent::PRE_SAVE, $model, $data);

		// validate
		$validator = $this->getValidator();
		if ($validator !== null && !$validator->validate($model)) {
			return new NotValid([
				'errors' => $validator->getValidationFailures()
			]);
		}

		// save and dispath post save hooks
		$rows = $model->save();
		$this->dispatch(ObjectEvent::POST_UPDATE, $model, $data);
		$this->dispatch(ObjectEvent::POST_SAVE, $model, $data);

		$payload = ['model' => $model];

		if ($rows === 0) {
			return new NotUpdated($payload);
		}

		return new Updated($payload);
	}
547842
public function updateParts($id, $data) {
		// find
		$model = $this->get($id);

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

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

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

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

		return NotUpdated(['model' => $model]);
	}
1324834
public static function update(array $id = [], array $data = [], ClientInterface $client = null)
    {
        return (new RequestService($client))
            ->setResourceClass(static::class)
            ->setResourcePath(static::RESOURCE_PATH . "/:" . static::RESOURCE_ID)
            ->update($id, $data);
    }
317373
public function save($id, array $data)
    {
        if(!empty($id) && (is_string($id) || is_numeric($id))) {
            $this->setFile($id);
            if ($this->file) {
                if (file_exists($this->file)) {
                    $this->update($id, $data);
                } else {
                    $this->add($id, $data);
                }
            }
        }
    }
992415
public function update($id, array $data)
    {
        $data['modified'] = GC_TIME;
        return (bool) $this->db->update('module_gapi_credential', $data, array('credential_id' => $id));
    }
665472
public function update($id, $data)
    {
        $message = $this->client->put(sprintf('templates/%d.json', $id), [
            'json' => $data,
        ]);

        return new Template($this->response($message));
    }
742917
public function update($id, $data)
    {
        $document = $this->client->put(
            sprintf('buckets/%d/documents/%d.json', $this->bucket, $id),
            [
                'json' => $data,
            ]
        );

        return new Document($this->response($document));
    }
576018
public function patch($api, $id, array $data = [])
    {
        return $this->checkException($this->callHttpMethod($this->normalizeUri($api, $id), Request::METHOD_PATCH, $data));
    }
920044
public function update($id, $data)
    {
        $sections = empty($data['sections']) ? [] : $data['sections'];

        return $this->_sendPayload(
            $this->_getService($this->_pageServiceKey)->updateTemplateSections($id, $sections)
        );
    }