@param $id int|array
@param $updateBind

@return StorageDataRequest
772982
public function getUpdateRequest($id, $updateBind)
    {
        $db = $this->_getConnection();
        $table = $this->table;
        $self = $this;
        $primary = $this->_getPrimaryKetArray();

        $request = new StorageDataRequest(
            [$id, $updateBind],
            function ($id, $updateBind) use ($db, $table, $self, $primary) {
                if (!$db) {
                    $self->logError('Missing connection on getUpdateRequest on table: ' . $table);
                    return false;
                }

                $keyBind = $self->prepareKey($primary, $id);

                $whereBind = $self->prepareBind($keyBind, $db);
                $whereArray = [];
                foreach ($whereBind as $key => $value) {
                    $whereArray[] = $key . ' = ' . $value;
                }

                $keys = [];
                $values = [];

                $updateBind = $self->prepareBind($updateBind, $db);

                foreach ($updateBind as $key => $value) {
                    $keys[] = $key;
                    $values[] = $value;
                }

                $query = 'UPDATE ' . $table
                    . ' SET (' . implode(',', $keys) . ') = ROW(' . implode(',', $values) . ') '
                    . ' WHERE ' . implode(' AND ', $whereArray)
                    . ' RETURNING *';
                $stmnt = $db->query($query);

                if (!$stmnt) {
                    $this->logError('Cannot execute getUpdateRequest on table: ' . $table . ':' . implode(',', $db->errorInfo()), [
                        'code' => $db->errorCode(),
                    ]);

                    return false;
                }

                $result = $stmnt->fetch(PDO::FETCH_ASSOC);

                if (!$result && (int) $stmnt->errorCode() > 0) {
                    $this->logError('Error on execution on getUpdateRequest on table: ' . $table . ':' . implode(',',
                            $stmnt->errorInfo()), [
                        'code' => $stmnt->errorCode(),
                    ]);

                    return false;
                }

                return $result;
            });

        return $request;
    }
1185502
public function update($id, array $data)
    {
        $this->validateId($id);

        $entity = $this->getById($id);
        $form   = $this->getEditForm();

        $form->bind($entity);
        $form->setData($data);

        if (!$valid = $form->isValid()) {
            return false;
        }

        $this->updateFromNode($entity);

        $this->getMapper()->save($entity);

        return $entity;
    }
1231962
public function actionIndexPost($id=NULL)
	{
		if ($id === NULL)
			return $this->createNewPost();
		else
			return $this->updatePost($id);
	}
260366
public function getInsertRequest($id, $insertBind)
    {
        $self = $this;
        $primary = $this->primaryKey;

        return new StorageDataRequest(
            [$id, $insertBind, $primary],
            function ($id, $insertBind, $primary) use ($self) {
                $insertBind[$primary] = $id;
                $queue = $insertBind[$self->getQueueKey()] ?? $self->getResource();
                $self->getRouter()->publish($insertBind, $queue);
                return $insertBind;
            }
        );
    }
844256
public function load($id = null)
    {
        if (!is_null($id)) {
            $this->setId($id);
        }

        $this->isLoaded = false;
        $data = $this->getDbGateway()->load($this->getId());
        if ($data) {
            $this->setData($data);
            $this->isLoaded = true;
        }

        return $this->isLoaded();
    }
765941
public function update($id, $data)
    {
        $data = $this->retrieveData($data);
        $updateData = [
            'methods'=> implode(',', $data['methods']),
        ];

        $this->table->update($updateData, ['id' => $id]);

        return $data;
    }
940105
public function update($id, $data)
    {
        $webhook = $this->client->put(
            sprintf('buckets/%d/webhooks/%d.json', $this->bucket, $id),
            [
                'json' => $data,
            ]
        );
        $webhook = new Webhook($this->response($webhook));
        $webhook->inContext($this->bucket);

        return $webhook;
    }
109136
public function updateByStringId(array $data, string $id): Model
    {
        $model = $this->byStringIdOrFail($id);

        return $this->updateByModel($model, $data);
    }
269666
public function update($id, UpdateUploadRequest $request)
    {
        $upload = $this->repository->find($id);

        if (empty($upload)) {
            return $this->sendError('Upload not found');
        }
        $all = $request->all();

        $upload = $this->repository->update($all, $id);
        $upload->load($request->getWith());

        return $this->sendResponse($upload, 'Upload updated successfully.');
    }
1215606
public static function updateId($id, $data, $params=[], $filter=false) {
        return static::dao()->updateId($id, $data, $params, $filter);
    }
980446
protected function _update($id, array $data)
    {
        return $this->db->update($this->table, $data, ['id' => $id]);
    }
203935
public function update(Update $request, $id)
    {
        try {
            $role = $this->repository->findById($id);

            $data = $request->all();

            $role->update($data);

            if ($role->permissions->count()) {
                $role->permissions()->detach($role->permissions->lists('id')->toArray());

                $role->permissions()->attach(\Input::get('permissions'));
            }

            if ($role->permissions->count() == 0 && count(\Input::get('permissions')) > 0) {
                $role->permissions()->attach(\Input::get('permissions'));
            }

            return $this->redirect('roles.index');
        } catch (ModelNotFoundException $e) {
            return $this->redirectNotFound();
        }
    }
792161
public function updateContentMetadata($contentId, Request $request)
    {
        $updateStruct = $this->inputDispatcher->parse(
            new Message(
                array('Content-Type' => $request->headers->get('Content-Type')),
                $request->getContent()
            )
        );

        $contentInfo = $this->repository->getContentService()->loadContentInfo($contentId);

        // update section
        if ($updateStruct->sectionId !== null) {
            $section = $this->repository->getSectionService()->loadSection($updateStruct->sectionId);
            $this->repository->getSectionService()->assignSection($contentInfo, $section);
            $updateStruct->sectionId = null;
        }

        // @todo Consider refactoring! ContentService::updateContentMetadata throws the same exception
        // in case the updateStruct is empty and if remoteId already exists. Since REST version of update struct
        // includes section ID in addition to other fields, we cannot throw exception if only sectionId property
        // is set, so we must skip updating content in that case instead of allowing propagation of the exception.
        foreach ($updateStruct as $propertyName => $propertyValue) {
            if ($propertyName !== 'sectionId' && $propertyValue !== null) {
                // update content
                $this->repository->getContentService()->updateContentMetadata($contentInfo, $updateStruct);
                $contentInfo = $this->repository->getContentService()->loadContentInfo($contentId);
                break;
            }
        }

        try {
            $locationInfo = $this->repository->getLocationService()->loadLocation($contentInfo->mainLocationId);
        } catch (NotFoundException $e) {
            $locationInfo = null;
        }

        return new Values\RestContent(
            $contentInfo,
            $locationInfo
        );
    }
593528
public function update($id, array $data)
    {
        return $this->model->where($this->model->getKeyName(), $id)->update($data);
    }
423587
public function update($id, $dbConnection = NULL)
    {
        $connection = DatabaseQuery::checkConnection($dbConnection);

        $updateQuery = $this->updateQuery(self::getTableName($connection), $id);
        $statement = $connection->prepare($updateQuery);
        if ($statement->execute()) {
            return true;
        }
        throw new  DataAlreadyExistException();
    }
130363
public function update($id, array $attributes)
    {
        if ($this->can('update')) {

            $this->flow->getLogger()->debug("Updating Resource Id: $this->id => $id");

            $attributes = $this->updateableAttributes
                ? array_intersect_key($attributes, array_flip($this->updateableAttributes))
                : $attributes;

            return $this->make(
                $this->performUpdate(
                    array_merge($attributes, [$this->id => $id])
                )
            );
        }

        throw new \BadMethodCallException('Method '.__FUNCTION__.' does not exist');
    }
631904
public function select($id = null)
    {
        if ($id instanceof UploadedFile) {
            if (!$id->isValid()) {
                throw new \InvalidArgumentException('Upload was not successful');
            }

            $newFile = $id->move($this->targetDirectory, $this->generateTargetFilename($id));

            $selection = new StorageSelection(
                new \SplFileInfo($newFile),
                $this->targetDirectory.'/'.$newFile->getFilename(),
                $id->getClientOriginalName());

            return $selection;
        }

        return parent::select($id);
    }