Update spesific data

@param  array $pairs
@param  mixed $terms

@return int|false
199460
public static function patch($pairs = null, $terms = null)
    {
        $self = self::newSelf();

        if (!$self->table()) {
            return false;
        }

        if (!empty($self->attributes) && null === $terms) {
            $terms = $self->attributes;
        }

        if (empty($pairs)) {
            throw new \LogicException('Could not update empty data');
        }

        if ($self->timestamps) {
            $pairs[self::UPDATED] = $self->freshDate();
        }

        $query = $self->update($pairs);

        $self->normalizeTerms($query, $terms);

        if ($result = $query->execute()) {
            $self->attributes = array_merge($self->attributes, $pairs);

            return $result;
        }

        return 0;
    }
630841
public function update($data = [], $wheres = [])
    {
        if (is_array($wheres) && count($wheres) > 0) {
            foreach ($wheres as $column => $column_value) {
                if (is_array($column_value)) {
                    $this->db->where($column, $column_value, self::OPERATOR_IS_IN);
                } else {
                    $this->db->where($column, $column_value, self::OPERATOR_EQUAL_TO);
                }
            }
        }
        if ($this->db->update($this->table, $data)) {
            return (int) $this->db->count;
        }

        return 0;
    }
1085747
public function setTerms($terms, $vocabulary_id = null)
    {
        $this->removeTerms($vocabulary_id);

        foreach ($terms as $term_id) {
            $this->addTerm($term_id);
        }
    }
824051
public function update(array $sets, $conditions = [])
    {
        if (count($sets)) {
            $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id';

            if (empty($conditions)) {
                if (isset($sets[ $primaryKey ])) {
                    $conditions = [$primaryKey => $sets[ $primaryKey ]];
                }
            }

            if (method_exists($this, 'updateRecordSets')) {
                $this->updateRecordSets($sets);
            }

            if (method_exists($this, 'beforeUpdate')) {
                $sets = $this->beforeUpdate($sets);
            }

            if (method_exists($this, 'getRecordOrdering')) {
                if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) {
                    $sets[ 'record_ordering' ] = $this->getRecordOrdering($this->table);
                }
            }

            if ($this->qb->table($this->table)->update($sets, $conditions)) {

                if (method_exists($this, 'afterUpdate')) {
                    return $this->afterUpdate();
                }

                return true;
            }
        }

        return false;
    }
678701
public function update(array $items = [])
    {
        $brandId = $this->getDefaultBrandId();
        $changed = $this->verify($items, $brandId);

        Memory::make('component.default')->put('terminate', (int) $changed);
        if ($changed) {
            $this->keyMap = [];
        }
        if ($changed && $this->cache instanceof Repository) {
            $this->cache->forget($this->cacheKey);
        }
    }
1098071
public function updateExisting(array $attributes, array $options = []) : bool
    {
        if (!$this->exists) {
            return false;
        }

        return $this->forceFill($attributes)->save($options);
    }
67436
public function update($subscriptions)
    {
        $this->initCollection();

        /** @var SubscriptionInterface $subscription */
        foreach ($subscriptions as $subscription) {
            $this->changeSubscription(
                $subscription,
                (bool)$subscription->getSubscriberStatus() === true ?
                    Subscriber::STATUS_SUBSCRIBED :
                    Subscriber::STATUS_UNSUBSCRIBED
            );
        }

        return $this->statusResponseFactory->create()
            ->setStatus('ok');
    }
1161096
public function update($fieldValues)
    {
        foreach ($fieldValues as $field => $value) {
            if ($value instanceof ExpressionInterface) {
                if ($value instanceof Increment) {
                    $fieldValues[] = "[$field]=[$field]" . ($value->step >= 0 ? '+' : '') . $value->step;
                } elseif ($value instanceof Raw) {
                    $fieldValues[] = "[$field]=" . $value->expression;
                }
                unset($fieldValues[$field]);
            }
        }

        return $this->getConnection()->update($this->getSource(), $fieldValues, $this->_conditions, $this->_bind);
    }
307524
public function update(array $values) {
		$sql = $this->buildUpdateSQL($values);
		$params = $this->getParameters();
		return $this->db->query($sql, $params)->affected();
	}
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;
    }
752920
public function updateMany(array $sets)
    {
        $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id';

        if (method_exists($this, 'updateRecordSets')) {
            foreach ($sets as $key => $set) {
                $this->updateRecordSets($sets[ $key ]);
            }
        }

        if (method_exists($this, 'beforeUpdateMany')) {
            $this->beforeUpdateMany($sets);
        }

        if ($this->qb->table($this->table)->updateBatch($sets, $primaryKey)) {
            if (method_exists($this, 'afterUpdateMany')) {
                return $this->afterUpdateMany();
            }

            return $this->db->getAffectedRows();
        }

        return false;
    }
1178685
public function update(array $attributes = [])
    {
        $this->fill($attributes);

        $modifications = $this->getModifications();

        if (count($modifications) > 0) {
            $this->fireModelEvent(new Events\Updating($this));

            // Push the update.
            if ($this->query->getConnection()->modifyBatch($this->getDn(), $modifications)) {
                // Re-sync attributes.
                $this->syncRaw();

                $this->fireModelEvent(new Events\Updated($this));

                // Re-set the models modifications.
                $this->modifications = [];

                return true;
            }

            // Modification failed, return false.
            return false;
        }

        // We need to return true here because modify batch will
        // return false if no modifications are made
        // but this may not always be the case.
        return true;
    }
1322563
public function set(array $pairs)
	{
		foreach ($pairs as $column => $value)
		{
			$this->_set[] = array($column, $value);
		}

		return $this;
	}
1024297
public function update($models)
    {
        if ($models->isEmpty()) {
            return;
        }

        $index = $this->algolia->initIndex($models->first()->searchableAs());

        if ($this->usesSoftDelete($models->first()) && $this->softDelete) {
            $models->each->pushSoftDeleteMetadata();
        }

        $objects = $models->map(function ($model) {
            if (empty($searchableData = $model->toSearchableArray())) {
                return;
            }

            return array_merge(
                ['objectID' => $model->getScoutKey()],
                $searchableData,
                $model->scoutMetadata()
            );
        })->filter()->values()->all();

        if (! empty($objects)) {
            $index->saveObjects($objects);
        }
    }
438351
public function update($table, array $values){
        $res= FALSE;
        try{
            $query= $this->prepareUpdate($table, $values, $this->where);
            //Uno los values pasados y los del where
            $values= array_merge($values, $this->where_values);
            //Ejecuto la consulta
            $query->execute($values);
            //Veo si salio todo bien
            $res= $this->isOk($query);
            //Limpio las variables del AR
            $this->cleanVars();
        } catch (\PDOException $e) {
            $this->cleanVars();
            throw $e;
        }
        return $res;
    }
992070
public function update($fieldValues)
    {
        $r = 0;
        foreach ($this->queries as $query) {
            $t = $query->update($fieldValues);
            $r += $t;
        }

        return $r;
    }
1115207
private function removeDuplicates(array $pairs, array $pair): array
    {
        if (!in_array($pair, $pairs, true)) {
            $pairs[] = $pair;
        }

        return $pairs;
    }