Updates a resource object or a list of resource objects

@param string Resource location, e.g. "basket"
@param string Related resource, e.g. "product"
@return string Generated output
320157
public function patchAction( $resource, $related )
	{
		$response = $this->createClient( $resource, $related )->patch( $this->getPsrRequest(), new Response() );
		return $this->setPsrResponse( $response );
	}
812663
public function updateRelations($entity) {
        $mapper = MapperBuilder::buildFromMapping($this->mapping, get_class($entity));
        foreach ($mapper->getRelations() as $relation) {
            if ($relation->getCardinality() == Relation::$manyToMany) {
                // delete previous relations
                $queryDeletePrevious = $this->buildDeleteRelationQuery($relation, $entity);
                $this->conn->executeNonQuery($queryDeletePrevious);

                // insert new relations
                $queryRel = $this->buildRelationQuery($entity);
                foreach (explode(";", $queryRel) as $q) {
                    if (strlen($q) > 5)
                        $this->conn->executeInsert($q);
                }
            }
            if ($relation->getCardinality() == Relation::$oneToMany) {
                $relMapper = MapperBuilder::buildFromName($this->mapping, $relation->getEntity());
                $m = "get" . $relation->getName();
                $setid = "set" . $relMapper->getNameForColumn($relation->getForeignColumn());

                // save actual relations
                foreach ($entity->$m() as $relEntity) {
                    $relEntity->$setid($entity->getId());
                    $this->save($relEntity);
                }

                //  delete old relations.
                // TODO: delete old relations
            }
        }
    }
1057040
public function update(Resource $resource)
    {
        $data = $resource->toArray();

        $user = $this->userManager->findUserByUsername($data['username']);
        if (!$user) {
            $errorMessage = $this->translator->trans('error.user_not_found', array('%username%' => $data['username']));
            throw new NotFoundHttpException($errorMessage);
        }

        $user->setUsername($data['username']);
        $user->setEmail($data['email']);
        $user->setPlainPassword($data['password']);
        $user->setEnabled(true);
        $this->userManager->updateUser($user);
    }
738735
public function update(string $index, array $attributes, array $toMany): int
    {
        $updated        = 0;
        $pkName         = $this->getModelSchemas()->getPrimaryKey($this->getModelClass());
        $filters        = [
            $pkName => [
                FilterParameterInterface::OPERATION_EQUALS => [$index],
            ],
        ];
        $allowedChanges = $this->filterAttributesOnUpdate($attributes);
        $saveMain       = $this
            ->createBuilder($this->getModelClass())
            ->updateModels($allowedChanges)
            ->addFiltersWithAndToTable($filters);
        $saveMain       = $this->builderSaveResourceOnUpdate($saveMain);
        $saveMain->getSQL(); // prepare

        $this->clearBuilderParameters()->clearFetchParameters();

        $this->inTransaction(function () use ($saveMain, $toMany, $index, &$updated) {
            $updated = $saveMain->execute();

            $builderHook = Closure::fromCallable([$this, 'builderSaveRelationshipOnUpdate']);
            foreach ($toMany as $relationshipName => $secondaryIds) {
                $connection = $saveMain->getConnection();

                // clear existing
                $this->builderCleanRelationshipOnUpdate(
                    $relationshipName,
                    $this
                        ->createBuilderFromConnection($this->getConnection(), $this->getModelClass())
                        ->clearToManyRelationship($relationshipName, $index)
                )->execute();

                // add new ones
                $updated   += $this->addInToManyRelationship(
                    $connection,
                    $index,
                    $relationshipName,
                    $secondaryIds,
                    $builderHook
                );
            }
        });

        return (int)$updated;
    }
1305219
public function update(string $pr, array $params = [])
    {
        $path = $this->buildPullRequestsPath($pr);

        return $this->put($path, $params);
    }
1015336
public function update(ResourceInterface $resource)
    {
        $event = $this->createResourceEvent($resource);
        $this->dispatcher->dispatch($this->config->getEventName('pre_update'), $event);

        if (!$event->isPropagationStopped()) {
            $this->persistResource($event);

            $this->dispatcher->dispatch($this->config->getEventName('post_update'), $event);
        }

        return $event;
    }
142230
public function update($request) {
        $this->resolveModel();
        $model = Dir::apiModel($this->model);
        $modelFind = $model::find($request->id);

        if(!empty($request->relationalModel)) {
            $idRelationalModel = trim(strtolower($request->relationalModel), 's');
            $idRelationalModel =  $idRelationalModel.'Id';
            if($modelFind->$idRelationalModel != $request->idRelational) killer('400');
        }

        foreach($modelFind->getTuples() as $tuple)
            if(!empty($request->$tuple))
                $modelFind->$tuple = $request->$tuple;

        $modelFind->update();
        return $modelFind;
    }
840019
def update(self, user, **kwargs):
        """"""
        yield self.get_parent()

        if not self.parent.editable:
            err = 'Cannot update child of {} resource'.format(self.parent.state.name)
            raise exceptions.Unauthorized(err)

        yield super(SubResource, self).update(user, **kwargs)
1192148
public function update($name, $id, HttpResourceInterface $resource)
    {
        $definition = $this->capabilities->get($name);
        $this->client->update(
            $definition->getUrl() . (string) $id,
            $resource
        );

        return $this;
    }
1099776
protected function createClient( $resource, $related = null )
	{
		$context = $this->getContext( 'client/jsonapi/templates' );
		return \Aimeos\Client\JsonApi::create( $context, $resource . '/' . $related );
	}
834260
public function relatedPatch(ApiRequest $request, $resourceModel)
    {
        $requestModel = $request->asRequestModel();

        $this->validate($requestModel, $this->getUpdatingRules());

        /** @var BelongsToMany $relation */
        $relation = $this->getRelation($resourceModel);

        $data = $requestModel->map(function (RequestModel $model) use ($relation) {
            $attributes = $this->getUpdatableAttributes($relation, $model);
            if (!empty($attributes)) {
                return [$model->id() => $attributes];
            }

            return $model->id();
        });

        $relation->sync($data->all());

        return $this->getRelation($resourceModel->fresh())->get();
    }
1193330
function postStore( $objectAttribute )
    {
        // Update url-object link
        $urlValue = $objectAttribute->content();
        if ( trim( $urlValue ) != '' )
        {
            $urlID = eZURL::registerURL( $urlValue );
            $objectAttributeID = $objectAttribute->attribute( 'id' );
            $objectAttributeVersion = $objectAttribute->attribute( 'version' );

            $db = eZDB::instance();
            $db->begin();

            $objectLinkList = eZURLObjectLink::fetchLinkObjectList( $objectAttributeID, $objectAttributeVersion );

            // In order not to have duplicated links, delete existing ones that have been created during the version creation process
            // and create a clean one (we can't update url_id since there's no primary key). This fixes EZP-20988
            if ( !empty( $objectLinkList ) )
            {
                eZURLObjectLink::removeURLlinkList( $objectAttributeID, $objectAttributeVersion );
            }

            $linkObjectLink = eZURLObjectLink::create( $urlID, $objectAttributeID, $objectAttributeVersion );
            $linkObjectLink->store();

            $db->commit();
        }
    }
365623
@PUT
    public Response conditionalUpdate(final String resource)
            throws IOException {
        return execute(getResourceRequest(RequestTypeEnum.PUT, RestOperationTypeEnum.UPDATE).resource(resource));
    }
722387
public function update_item( $request ) {
		if ( ! empty( $request['post'] ) && in_array( get_post_type( $request['post'] ), array( 'revision', 'attachment' ), true ) ) {
			return new WP_Error( 'rest_invalid_param', __( 'Invalid parent type.' ), array( 'status' => 400 ) );
		}
		$response = parent::update_item( $request );
		if ( is_wp_error( $response ) ) {
			return $response;
		}

		$response = rest_ensure_response( $response );
		$data = $response->get_data();

		if ( isset( $request['alt_text'] ) ) {
			update_post_meta( $data['id'], '_wp_attachment_image_alt', $request['alt_text'] );
		}

		$attachment = $this->get_post( $request['id'] );

		$fields_update = $this->update_additional_fields_for_object( $attachment, $request );
		if ( is_wp_error( $fields_update ) ) {
			return $fields_update;
		}

		$request->set_param( 'context', 'edit' );
		$response = $this->prepare_item_for_response( $attachment, $request );
		$response = rest_ensure_response( $response );

		/* This action is documented in lib/endpoints/class-wp-rest-attachments-controller.php */
		do_action( 'rest_insert_attachment', $data, $request, false );

		return $response;
	}
49802
protected function setupUpdateReference($resource)
    {
        foreach ($resource->settings['actions']['UpdateReference']['uris'] as $property => $uri) {
            $this->setupUpdate($resource, $uri, $property);
        }
    }
1132619
public function setRelation($name, $related_object)
    {
        //if no related object is supplied, set it to false (an array
        //value of null will not pass an isset() check on the
        //relation_objects array).
        if (!$related_object) {
            $related_object = false;
        }

        $this->relation_objects[$name] = $related_object;
    }
1057315
public function update($type, $productId, $linkedProductId, $data, $identifierType = null)
    {
        return $this->__createAction('catalog_product_link.update', func_get_args());
    }