Updates record in data array and returns record ID.

@param Model  $m
@param mixed  $id
@param array  $data
@param string $table

@return mixed
776505
public function update(Model $m, $id, $data, $table = null)
    {
        if (!isset($table)) {
            $table = $m->table;
        }

        $data = $this->typecastSaveRow($m, $data);

        $this->data[$table][$id] =
            array_merge(
                isset($this->data[$table][$id]) ? $this->data[$table][$id] : [],
                $data
            );

        return $id;
    }
898207
private function update($id, $data)
    {
        foreach ($data as $key => $value) {
            $fields[] = $key . ' = ?';
        }
        $query = 'UPDATE ' . self::DIAGNOSTIC_TABLE . ' SET ' . implode(', ', $fields) .
                 ' WHERE ' . self::DIAGNOSTIC_ID . ' = ?';
        return $this->persistence->exec($query, array_merge(array_values($data), array($id)));
    }
1190677
public function create(string $table, array $data)
    {
        $data['created_at']=time();
        $this->db->insert($table, $data);
        $id=$this->db->id();
        if ($id) {
            return $id;
        } else {
            return false;
        }
    }
1007006
public static function update( $table, $data = null, $handler = null ) 
	{
		return Query::update( $table, $data, $handler );
	}
532245
public function write($id, $data)
    {
        try {
            return $this->db->write($id, $data);
        } catch (\Exception $e) {
            throw $e;
        }
    }
632045
public function update($id, $data)
    {
        $layout = isset($data['layout']) ? $data['layout'] : null;

        return $this->_sendPayload(
            $this->_getService($this->_pageServiceKey)->updateTemplateLayout($id, $layout)
        );
    }
1126545
public function buildUpdateSQL($table = null, $data = array())
	{
		$sql = 'update ' . $this->parseTable($table) . ' set ';
		if(is_string($data))
		{
			$sql .= $data . ' ';
		}
		else
		{
			$data = $this->parseParams($data);
			foreach($data as $key => $value)
			{
				$sql .= $this->parseKeyword($key) . '=:' . $this->parseParamName($key) . ',';
			}
		}
		$where = $this->parseCondition(isset($this->operationOption['where']) ? $this->operationOption['where'] : '');
		if ('' !== $where)
		{
			$where = 'where ' . $where . ' ';
		}
		return substr($sql,0,-1) . ' '
				. $where
				. $this->parseOrder()
				. $this->parseLimit()
				. $this->parseLock()
				;
	}
374529
public function update(array $data, $field, $id)
    {
        $this->applyCriteria();

        /** @var Model $model */
        $model = $this->model->where($field, $id)->first();

        $model->fill($data)->save();

        return $model;
    }
821579
public function insertId($table, $data)
    {
        try {
            $this->insert($table, $data);
            return $this->sql->lastInsertId();
        } catch (\Exception $e) {
            Throw $e;
        }
    }
64301
public function update($id, $data)
    {
        $routeMatch = $this->getEvent()->getRouteMatch();
        $mode = $routeMatch->getParam('mode', false);
        $type = $routeMatch->getParam('type', false);
        $endpoint = $routeMatch->getParam('endpoint', false);
        $annee = $routeMatch->getParam('annee', 0);
        
        $processStateHandler = $this->getProcessStateHandler();
        $process = $processStateHandler->getProcess($mode, $type, $endpoint, $annee);
        
        if (is_null($process)) {
            $process = $processStateHandler->getDefaultProcess($mode, $type, $endpoint, $annee);
            $processStateHandler->saveProcess($process);
        }
        if (array_key_exists('force-execution-stop', $data)) {
            $process->setInterrupted(true);
        } else {
            $active = array_key_exists('active', $data) && $data['active'] === 'true';
            $process->setActive($active);
            $shedule = $data['shedule'] === 'true' && $data['active'] === 'true';
            $process->setShedule($shedule);
            $process->setCron($shedule ? $data['cron'] : null);
        }
        
        $processStateHandler->saveProcess($process);
        $response = $this->getResponse();
        $response->getHeaders()->addHeaderLine('Content-Type', 'application/json');
        $serializer = $this->getSerializer();
        $processJson = $serializer->serialize($process, 'json');
        $response->setContent($processJson);
        return $response;
    }
606866
public function write($id, $data)
	{
		$tableName = $this->db->parseField($this->tableName);
		$sessionIDField = $this->db->parseField('session_id');
		$dataField = $this->db->parseField('data');
		$updateTimeField = $this->db->parseField('update_time');
		$result = $this->db->query(<<<SQL
select * from {$tableName} where {$sessionIDField} = %s
SQL
,array($id));
		$updateTime = time();
		if(isset($result['session_id']))
		{
			return $this->db->execute(<<<SQL
update {$tableName} set {$dataField} = %s,{$updateTimeField} = %s where {$sessionIDField} = %s
SQL
,array($data,$updateTime,$id));
		}
		else
		{
			return $this->db->execute(<<<SQL
insert into {$tableName}({$sessionIDField},{$dataField},{$updateTimeField}) values(%s,%s,%s)
SQL
,array($id,$data,$updateTime));
		}
	}
313915
public function update($id, $data) {
		$dt = $this->getDataTable();
		
		if (! $dt)
			return $this->createResponse($this->getNameManager()->getTableNames(), 401, "Tabels");
		
		return $this->createResponse([], 200, "{$this->getNameManager()->entityName}: No Update");
	}
397882
public function update(array $data, $id)
    {
        if (array_key_exists('password', $data)) {
            $data['password'] = bcrypt($data['password']);
        }

        return parent::update($data, $id);
    }
534278
public function update($data, $_id = NULL)
    {

        if ($_id) {
            $this->_id = $_id;
        }

        $parameters = [
            "id" => $this->_id,
            "body" => ['doc' => $data],
            'client' => ['ignore' => $this->ignores]
        ];

        if ($index = $this->getIndex()) {
            $parameters["index"] = $index;
        }

        if ($type = $this->getType()) {
            $parameters["type"] = $type;
        }

        return (object)$this->connection->update($parameters);
    }
1373520
public function save($model, $id, $data)
    {
        if (is_null($id)) { // insert
            $model->data = $this->sendCollectionRequest($model, $this->insert_mode, $data);
            $model->id = $model->data ? $model->data[$model->id_field] : null;
        } else { // update
            $model->data = $this->sendItemRequest($model, $id, $this->update_mode, $data);
            $model->id = $model->data ? $model->data[$model->id_field] : null;
        }

        return $model->id;
    }
528559
public function update($table, array $data)
    {
        $this->queryBuilder->update($table, $this->asData($data));
        return $this;
    }
1128921
public function update($id, $data = null)
    {
        $data = ($data) ?: request()->all();

        $isEditable = $this->isEditable($data);

        if (($response = $this->handleColumnUpdates($id, $data)) instanceof Response) {
            return $response;
        }

        /* @var Model $this->model */
        $builder = $this->model();

        if ($this->isSoftDeletes) {
            $builder = $builder->withTrashed();
        }

        $this->model = $builder->with($this->getRelations())->findOrFail($id);

        $this->setFieldOriginalValue();

        // Handle validation errors.
        if ($validationMessages = $this->validationMessages($data)) {
            if (!$isEditable) {
                return back()->withInput()->withErrors($validationMessages);
            }

            return response()->json(['errors' => Arr::dot($validationMessages->getMessages())], 422);
        }

        if (($response = $this->prepare($data)) instanceof Response) {
            return $response;
        }

        DB::transaction(function () {
            $updates = $this->prepareUpdate($this->updates);

            foreach ($updates as $column => $value) {
                /* @var Model $this->model */
                $this->model->setAttribute($column, $value);
            }

            $this->model->save();

            $this->updateRelation($this->relations);
        });

        if (($result = $this->callSaved()) instanceof Response) {
            return $result;
        }

        if ($response = $this->ajaxResponse(trans('admin.update_succeeded'))) {
            return $response;
        }

        return $this->redirectAfterUpdate($id);
    }