Changes the data in the user's table.

@param array $d The new data

@return bool
488752
public function update_info(array $d)
  {
    if ( $this->check_session() ){
      $update = [];
      foreach ( $d as $key => $val ){
        if (
          ($key !== $this->fields['id']) &&
          ($key !== $this->fields['cfg']) &&
          ($key !== 'auth') &&
          ($key !== 'pass') &&
          \in_array($key, $this->fields)
        ){
          $update[$key] = $val;
        }
      }
      if ( \count($update) > 0 ){
        $r = $this->db->update(
                $this->class_cfg['tables']['users'],
                $update,
                [$this->fields['id'] => $this->id]);
        /** @todo Why did I do this?? */
        $this->set_session(['cfg' => false]);
        $this->_user_info();
        return $r;
      }
    }
    return false;
  }
286933
public function updates($data)
    {
        $data = &$this->loadFilterData($data);
        if ( $data == false ) {
            return false;
        }
        $conditions = $this->sqlBuilder->buildCondition();
        return $this->db->update($this->table, $data, $conditions);
    }
786807
public function actionChangeSettings()
    {
        $params = Yii::$app->request->bodyParams;
        
        foreach ($params as $param => $value) {
            Yii::$app->adminuser->identity->setting->set($param, $value);
        }
        
        return true;
    }
1140315
public function alterTable($tableDiff)
    {
        $changeSetElt = $this->createChangeSet('alter-table-' . $tableDiff->fromTable->getName());

        $fromTableName = QualifiedName::fromAsset($tableDiff->fromTable);

        $fromTableName = $this->alterTableRenameTable($tableDiff, $fromTableName, $changeSetElt);

        $indexColumns = new IndexColumns($tableDiff->fromTable);

        $this->alterTableAddedColumns($tableDiff, $fromTableName, $indexColumns, $changeSetElt);
        $this->alterTableAddedIndexes($tableDiff, $fromTableName, $indexColumns, $changeSetElt);
        $this->alterTableAddedForeignKeys($tableDiff, $changeSetElt);

        $this->alterTableRenamedColumns($tableDiff, $fromTableName, $changeSetElt);
        $this->alterTableRenamedIndexes($tableDiff, $fromTableName, $changeSetElt);

        foreach ($tableDiff->changedColumns as $column) {
            $this->alterTableChangedColumn($column, $fromTableName, $changeSetElt);
        }

        foreach ($tableDiff->changedIndexes as $index) {
            $this->alterTableChangedIndex($index, $fromTableName, $changeSetElt);
        }

        foreach ($tableDiff->changedForeignKeys as $foreignKey) {
            $this->alterTableChangedForeignKey($foreignKey, $fromTableName, $changeSetElt);
        }

        $this->alterTableRemovedColumns($tableDiff, $fromTableName, $changeSetElt);
        $this->alterTableRemovedIndexes($tableDiff, $fromTableName, $changeSetElt);
        $this->alterTableRemovedForeignKeys($tableDiff, $fromTableName, $changeSetElt);

        $this->root->appendChild($changeSetElt);
    }
121727
public function update($id)
    {
        // set schema to sql
        $this->sql->setSchema($this->schema);
        // get data from sql
        $body = $this->sql->get($this->schema->getPrimaryFieldName(), $id);

        if (!is_array($body) || empty($body)) {
            return false;
        }

        try {
            return $this->resource->update(
                [
                    'index' => $this->schema->getName(),
                    'type' => static::INDEX_TYPE,
                    'id' => $id,
                    'body' => [
                        'doc' => $body
                    ]
                ]
            );
        } catch (Missing404Exception $e) {
            return false;
        } catch (NoNodesAvailableException $e) {
            return false;
        } catch (\Throwable $e) {
            // catch all throwable
            // if something went wrong, dont panic, just return false
            return false;
        }
    }
911619
public function update(array $data)
    {
        $affected = 0;
        foreach ($this->table->data['data'] as &$rs) {
            if ($this->matchWhere($rs)) {
                $rs = array_merge($rs, $data);
                $affected++;
            }
        }

        if ($affected) {
            $this->table->save();
        }

        return $affected;
    }
505514
public static function replace(array $data)
    {
        if (empty($data)) {
            return false;
        }

        // Case where $data is not an array of arrays.
        if (!isset($data[0])) {
            $data = [$data];
        }

        $sql = static::buildReplaceSql($data);

        $data = static::inLineArray($data);

        return self::getModelConnectionName()->affectingStatement($sql, $data);
    }
1013382
public function insert(array $data) : bool {
    $this->query_builder->resetProperties();
    $this->query_builder->setMode('insert');

    $columns = array_keys($data);

    $this->query_builder->setColumns($columns);
    $this->query_builder->setValues($columns);

    try {
      $stmt = parent::prepare($this->query_builder->getQuery());

      return $stmt->execute($data);
    } catch (PDOException $e) {
      $this->pdo_exception = $e;

      return false;
    }
  }
473540
public function update(array $data, $id)
    {
        $scene = '';
        if (func_num_args() === 3) {
            $scene = func_get_arg(2);
        }

        $this->setOriginal($data);

        $this->setData($this->guardResult($data, $scene));

        if ($this->fireEvent('updating', $data) === false) {
            return false;
        }

        $model = is_numeric($id) ?
            $this->driver->updateByIntId($this->getData(), $id) :
            $this->driver->updateByStringId($this->getData(), $id);

        $this->fireEvent('updated', $model);

        return $model;
    }
254688
public function write($id, $data)
    {
        $session = \Doctrine::getTable($this->_tableName)->find($id);
        if (false === $session) {
            $session = new $this->_tableName();
            $session->{$this->_primaryKeyColumn} = $id;
        }

        $session->{$this->_dataColumn} = $data;
        $session->{$this->_lifetimeColumn} = $this->_lifetime;
        $session->{$this->_modifiedColumn} = time();

        if ($session->save()) {
            return true;
        }

        return false;
    }
524029
public function change()
    {
        $table = $this->table('dashboards');
        $table->changeColumn('name', 'string', [
            'default' => null,
            'limit' => 255,
            'null' => false,
        ]);
        $table->update();
    }
509014
function put($data)
    {
        if ($this->_change == self::STATE_INSERT)
        {
            $this->_change = self::STATE_UPDATE;
            $this->_update = $data;
        }
        elseif ($this->_change == self::STATE_EMPTY)
        {
            $this->_change = self::STATE_INSERT;
            $this->_data = $data;
        }
    }
1227673
public function alterTable(TableDiff $tableDiff)
    {
        $queries = $this->_platform->getAlterTableSQL($tableDiff);
        if (! is_array($queries) || ! count($queries)) {
            return;
        }

        foreach ($queries as $ddlQuery) {
            $this->_execSql($ddlQuery);
        }
    }
396243
public function writeTable($d)
    {
        $this->flushBits();
        $table_data = new Writer();
        foreach ($d as $k => $va) {
            list($ftype, $v) = $va;
            $table_data->writeShortStr($k);
            if ($ftype == 'S') {
                $table_data->write('S');
                $table_data->writeLongStr($v);
            } else if ($ftype == 'I') {
                $table_data->write('I');
                $table_data->_writeSignedLong($v);
            } else if ($ftype == 'D') {
                // 'D' type values are passed Decimal instances.
                $table_data->write('D');
                $table_data->writeOctet($v->e);
                $table_data->_writeSignedLong($v->n);
            } else if ($ftype == 'T') {
                $table_data->write('T');
                $table_data->writeTimestamp($v);
            } else if ($ftype == 'F') {
                $table_data->write('F');
                $table_data->writeTable($v);
            } else if ($ftype = 'A') {
                $table_data->write('A');
                $table_data->writeArray($v);
            }
        }

        $table_data = $table_data->getvalue();
        $this->writeLong(strlen($table_data));
        $this->write($table_data);
        return $this;
    }
153402
public function changedColumnIs($column)
	{
		if( !$this->recordExists() )
		{
			return true;
		}
		elseif( $this->_recordAccess($column) && $this->_changedColumnAccess($column) )
		{
			return $this->recordColumnGet($column) != $this->changeRecordData[$column];
		}
		else
		{
			return true;
		}
	}
751388
public function change()
    {
        $table = $this->table('polls');
        $table->addColumn('author', 'string', array('limit' => 16))
              ->addColumn('question', 'string')
              ->addColumn('ended', 'boolean', array('null' => false, 'default' => 0))
              ->addColumn('bottom', 'boolean', array('null' => false, 'default' => 0))
              ->addColumn('hide_results', 'boolean', array('null' => false, 'default' => 0))
              ->create();

        $table->addForeignKey('author', 'user', 'user', array('delete'=> 'CASCADE', 'update'=> 'CASCADE'))
              ->save();

        $table = $this->table('polls_option');
        $table->addColumn('poll', 'integer')
              ->addColumn('text', 'string')
              ->create();

        $table->addForeignKey('poll', 'polls', 'id', array('delete'=> 'CASCADE', 'update'=> 'CASCADE'))
              ->save();

        $table = $this->table('polls_response');
        $table->addColumn('poll', 'integer')
              ->addColumn('option', 'integer')
              ->addColumn('ip', 'string')
              ->addColumn('useragent', 'string')
              ->create();

        $table->addForeignKey('poll', 'polls', 'id', array('delete'=> 'CASCADE', 'update'=> 'CASCADE'))
              ->addForeignKey('option', 'polls_option', 'id', array('delete'=> 'CASCADE', 'update'=> 'CASCADE'))
              ->save();

        $table = $this->table('article_polls');
        $table->addColumn('poll', 'integer')
              ->addColumn('article', 'integer')
              ->create();

        $table->addForeignKey('poll', 'polls', 'id', array('delete'=> 'CASCADE', 'update'=> 'CASCADE'))
              ->addForeignKey('article', 'article', 'id', array('delete'=> 'CASCADE', 'update'=> 'CASCADE'))
              ->save();

    }
468741
private function checkIfUserChanged(array $data)
    {
        $model = $this->getModel()->newQuery()->find($this->getVisitorData('id'));

        if (
            ! is_null($model) &&
            ! is_null($model->user_id) &&
            ! is_null($data['user_id']) &&
            $data['user_id'] !== $model->user_id
        ) {
            $newVisitor = $this->regenerateSystemVisitor($data);
            $model      = $this->findByUuid($newVisitor['uuid']);
            $model->update(Arr::except($data, ['id', 'uuid']));
        }
    }