Update a Model in the database.

@param array $attributes
@param Product|mixed $idOrModel
@param array $options

@return bool
177783
public function update(array $attributes, $idOrModel, array $options = [])
    {
    	$product = $this->modelOrFind($idOrModel);
    	$attributes = Collection::make($attributes);

    	$attr = $attributes->except('features', 'pictures', 'default_picture')->merge([
            'features' => \Antvel\Features\Parser::toJson($attributes->get('features')),
            'category_id' => $attributes->get('category'),
            'price' => $attributes->get('price') * 100,
            'cost' => $attributes->get('cost') * 100,
            'status' => $attributes->get('status'),
            'updated_by' => auth()->user()->id,
            'tags' => $attributes->get('name'),
        ])->all();

    	$this->updatePicturesFor($product, $attributes);

    	return $product->update($attr);
    }
138170
public function update(array $options = array())
    {
        $module = $this->utils()->whichModule($this);
        return $this->utils()->update($module, $options);
    }
962287
public function updateSql(array $attributes)
    {
        $attrs = [];
        foreach ($attributes as $key => $value) {
            $attrs[$this->getModel()->convertToPrimaryKeyName($key)] = $value;
        }

        $sql = $this
            ->getQueryBuilder()
            ->update()
            ->table($this->getModel()->tableName())
            ->values($attrs)
            ->toSQL();

        return $sql;
    }
260399
public function update(array $attributes = array())
    {
        if (! $this->exists) {
            return $this->newQuery()->update($attributes);
        }

        return $this->fill($attributes)->save();
    }
725980
public function updateAttributes(&$attributes)
    {
        if ($validator = $this->getValidator()) {
            
            if ($extra = $validator->getAttributesForField($this->owner)) {
                $attributes = array_merge($attributes, $extra);
            }
            
        }
    }
463260
protected function saveModel(Model $model, array $options = []) {
		if ($model->isInsertForced()) {
			unset($model->_id);
			$model->unforceInsert();
		}
		
		// Update
		if (isset($model->_id)) {
			$data = $model->getDataForUpdate();
			unset($data['_id']);

			$id = $this->normalizeId($model->_id);
			
			return $this->getAdapter()->update(
				$this->getTableName(),
				['_id'  => $id],
				['$set' => $data],
				$options
			);
		}
		
		// Insert
		return $this->getAdapter()->insert(
			$this->getTableName(),
			$model->getDataForInsert(),
			$options
		);
	}
1223080
public static function update($id, $params = [], $options = [])
    {
        $url = static::classUrl() . '/' . $id;
        return static::_directRequest('put', $url, $params, $options);
    }
959718
public function addAttribute($attribute, $value, $options = [])
    {
        $span = $this->getSpan($options);
        $span->addAttribute($attribute, $value);
    }
868742
public function update(array $attributes)
    {
        if ($this->related->usesTimestamps()) {
            $attributes[$this->relatedUpdatedAt()] = $this->related->freshTimestampString();
        }

        return $this->query->update($attributes);
    }
252855
public function update(Identifiable $model, array $newAttributes)
    {
        if (!$this->fill($model, $newAttributes)) {
            return false;
        }
        return $this->save($model);
    }
120807
protected function performUpdate(array $attributes, array $options = null)
    {
        return $this->flow->send(
            'post',
            $this->endpoint . '/' . ($options['method'] ?? $this->verbsMap['update'] ?? 'edit'),
            $attributes
        );
    }
1166860
public function updateFromArray(array $attributes)
    {
        $this->id       = array_get($attributes, 'id', $this->id);
        $this->qty      = array_get($attributes, 'qty', $this->qty);
        $this->name     = array_get($attributes, 'name', $this->name);
        $this->price    = array_get($attributes, 'price', $this->price);
        $this->priceTax = $this->price + $this->tax;
        $this->options  = new CartItemOptions(array_get($attributes, 'options', $this->options));

        $this->rowId = $this->generateRowId($this->id, $this->options->all());
    }
939557
public function updateMany(array $aIds, array $aData = []): bool
    {
        $oDb = Factory::service('Database');
        try {
            $oDb->trans_begin();
            foreach ($aIds as $iId) {
                if (!$this->update($iId, $aData)) {
                    throw new ModelException('Failed to update item with ID ' . $iId);
                }
            }
            $oDb->trans_commit();
            return true;
        } catch (\Exception $e) {
            $oDb->trans_rollback();
            $this->setError($e->getMessage());
            return false;
        }
    }
1242735
public function update(array $values, array $options = [])
    {
        // Use $set as default operator.
        if (!Str::startsWith(key($values), '$')) {
            $values = ['$set' => $values];
        }

        // Update multiple items by default.
        if (!array_key_exists('multiple', $options)) {
            $options['multiple'] = true;
        }

        $wheres = $this->compileWheres();

        $result = $this->collection->updateMany($wheres, $values, $options);

        if (1 == (int) $result->isAcknowledged()) {
            return $result->getModifiedCount() ? $result->getModifiedCount() : $result->getUpsertedCount();
        }

        return 0;
    }
665216
public function updateOrCreate(array $attributes, array $values = [])
    {
        $this->applyScope();

        if (!is_null($this->validator)) {
            $this->validator->with($attributes)->passesOrFail(ValidatorInterface::RULE_UPDATE);
        }

        $temporarySkipPresenter = $this->skipPresenter;

        $this->skipPresenter(true);

        $model = $this->model->updateOrCreate($attributes, $values);

        $this->skipPresenter($temporarySkipPresenter);
        $this->resetModel();

        event(new RepositoryEntityUpdated($this, $model));

        return $this->parserResult($model);
    }
666635
public function update(array $attributes)
    {
        return $this->validate($attributes) ? (boolean) Language::where('id', $attributes['id'])->update($attributes) : false;
    }
153616
public function update(array $attributes = [], array $options = [])
    {
        if (! $this->exists) {
            return false;
        }

        // If dirty attributes contains binary field
        // extract binary fields to new array
        if ($this->extractBinaries($attributes)) {
            return $this->newQuery()->updateLob($attributes, $this->binaryFields, $this->getKeyName());
        }

        return $this->fill($attributes)->save($options);
    }