update model with $key => $value in $data

@param array $data
@param bool  $autoSave
@return $this
359927
final public function update($data = [], $autoSave = true)
    {
        foreach ($data as $key => $value) {
            if ($value === null) {
                continue;
            } else if (property_exists($this, $key) && method_exists($this, $key)) {
                $this->$key($value);
            }
        }
        if ($autoSave) {
            $this->save();
        }
        return $this;
    }
694610
public function setData($data) 
	{
		if(is_array($data)) {
			$this->data = $data;
		}
		
		$args = func_get_args();
		$this->data[$args[0]] = $args[1];
		
		return $this;
	}
705437
public function updateOrInsert($table, array $data = [])
    {
        $primaryKeys = $this->repository->getCache()->getTablePrimaryKeys($table);

        if (strpos($table, '_i18n')) {
            $primaryKeys = ['id', 'language_id'];
        } elseif (strpos($table, '_p17n')) {
            $primaryKeys = ['id', 'user_group_id'];
        }

        /**
         * @T00D00 - bug for translations, permissions ...!
         */
        if (!$primaryKeys) {
            return;
        }

        foreach ($primaryKeys as $primaryKey) {
            if (!isset($data[$primaryKey])) {
                return;
            }
        }

        $entity = (new Entity($this->repository))->setTable($table);
        foreach ($primaryKeys as $primaryKey) {
            $entity->where($primaryKey, $data[$primaryKey]);
        }

        $entity->select(['`' . $table . '`.*']);
        $record = $entity->one();

        if ($record) {
            return $this->update($table, $data);
        }

        return (new InsertRecord($this->record, $this->entity, $this->repository))
            ->setTables($table)
            ->execute();
    }
300542
public function updateByPrimaryKey($key, array $data)
    {
        $this->updateByField($this->entity->getPrimaryKey(), $key, $data);
    }
210716
public function updateData(array $data) {
        foreach($data as $name => $value) {
            $this->data[$name] = $value;
        }
    }
617627
public function update(array $data)
    {
        if (is_null($this->schema)) {
            throw SystemException::forNoSchema();
        }

        $table = $this->schema->getName();
        $updated = $this->schema->getUpdatedFieldName();

        if ($updated) {
            $data[$updated] = date('Y-m-d H:i:s');
        }

        return $this
            ->resource
            ->model($data)
            ->save($table)
            ->get();
    }
102406
public function update(array $data, $VoucherType = null)
  {
    if(empty($VoucherType))
    {
      $VoucherType = $this->byId($data['id']);
    }

    foreach ($data as $key => $value)
    {
      $VoucherType->$key = $value;
    }

    return $VoucherType->save();
  }
190886
public function update(array $data = [])
    {
        $sql = 'update `' . $this->table . '` set ';
        $sql .= Util::rangeField(Util::add2points(array_keys($data)));

        if (!is_null($this->where)) {
            $sql .= ' where ' . $this->where;

            $this->where = null;

            $data = array_merge($data, $this->where_data_binding);

            $this->where_data_binding = [];
        }

        $stmt = $this->connection->prepare($sql);

        $data = Sanitize::make($data, true);

        $this->bind($stmt, $data);

        // Execution of the request
        $stmt->execute();

        $r = $stmt->rowCount();

        return (int) $r;
    }
790117
public function update(array $data)
    {
        $perm = $this->findOrFail($data['id']);

        $perm->name = $data['name'];
        $perm->permissions = $data['permissions'];
        $perm->save();

        $this->event->fire('permissions.update',array($perm));

        return true;
    }
941850
public function appendData($key, $data)
    {
        $this->_putData($key, $data);

        if ($this->_objectCreation) {
            return $this->_afterAppendDataToNewObject();
        }
        return $this;
    }
414629
public function update(array $data)
    {
        $todo = Basecamp::todos($this->bucket->id)->update($this->id, $data);

        $this->setAttributes($todo);

        return $todo;
    }
791200
public function setValues(array $data)
    {
        foreach($data as $key => $value) {
           $this->set($key, $value);
        }

        return $this;
    }
545578
public function update(array $data)
    {
        return $this->forge->updateMysqlDatabase($this->serverId, $this->id, $data);
    }
1069423
private function setValues(array $data)
    {
        foreach ($data as $key => $datum) {
            $this->set($key, $datum);
        }
        return $this;
    }
397882
public function update(array $data, $id)
    {
        if (array_key_exists('password', $data)) {
            $data['password'] = bcrypt($data['password']);
        }

        return parent::update($data, $id);
    }
592736
protected function setValidationVariables(array $data, $nestedKey = null)
    {
        foreach ($data as $key => $value) {
            // Add support for nested arrays
            $key = ! empty($nestedKey) ? $nestedKey.'.'.$key : $key;

            // If value is an array, we need to created a nested key
            // until we reach the final value.
            if (is_array($value)) {
                $this->setValidationVariables($value, $key);
            } else {
                $this->variables['{:'.$key.'}'] = $value;
            }
        }

        return $this;
    }
364147
public function update($id, array $data)
    {
        $model = $this->read($id)->fill($data);
        return $model->save();
    }