Adds data to the table.

@param array $data A two dimensional array with the table data.
@param integer $col_id Starting column number.
@param integer $row_id Starting row number.

@return void
332599
function addData($data, $col_id = 0, $row_id = 0) {
        foreach ($data as $row) {
            if ($row === self::CONSOLE_TABLE_HORIZONTAL_RULE) {
                $this->_data[$row_id] = self::CONSOLE_TABLE_HORIZONTAL_RULE;
                $row_id++;
                continue;
            }
            $starting_col = $col_id;
            foreach ($row as $cell) {
                $this->_data[$row_id][$starting_col++] = $cell;
            }
            $this->_updateRowsCols();
            $this->_max_cols = max($this->_max_cols, $starting_col);
            $row_id++;
        }
    }
443246
public function write($id, $data)
    {
        $data = base64_encode($data);
        $data = array(
            $this->options->getModifiedColumn() => time(),
            $this->options->getDataColumn()     => (string) $data,
        );

        $rows = $this->tableGateway->select(array(
            $this->options->getIdColumn()   => $id,
            $this->options->getNameColumn() => $this->sessionName,
        ));

        if ($row = $rows->current()) {
            return (bool) $this->tableGateway->update($data, array(
                $this->options->getIdColumn()   => $id,
                $this->options->getNameColumn() => $this->sessionName,
            ));
        }
        $data[$this->options->getLifetimeColumn()] = $this->lifetime;
        $data[$this->options->getIdColumn()]       = $id;
        $data[$this->options->getNameColumn()]     = $this->sessionName;

        return (bool) $this->tableGateway->insert($data);
    }
113799
public function _write($id, $data) {
        $access = time();
        
        ORM::for_table($this->sessions_table)->raw_execute("REPLACE INTO " . $this->sessions_table . " VALUES (:id, :access, :data)", ['id' => $id, 'access' => $access, 'data' => $data]);
    }
1019200
public function update($table_name, $id, array $data) {
            Event::dispatch(EventData::forBefore(Event::BEFORE_UPDATE, $table_name, $data), $data);


            $q = $this->config->getSystemIdentifierQuote();

            //update database record
            $sql_query = "UPDATE $q" . $table_name . "$q SET ";

            $statement_params = [':update_id' => $id];
            // keep track of null params for logging output. binding null params
            // was causing foreign key violations (for nullable fields)
            $null_params = [];
            foreach ($data as $field_name => $value) {
                if (strtolower($value) == 'null' || is_null($value)) {
                    $sql_query .= "\n$q" . $field_name . "$q = NULL,";
                    $null_params[ $field_name ] = 'NULL';
                } else {
                    $sql_query .= "\n$q" . $field_name . "$q = :" . $field_name . ",";
                    $statement_params[ ':' . $field_name ] = $value;
                }
            }

            $full_param_list = array_merge($null_params, $statement_params);

            $sql_query = substr($sql_query, 0, -1); // remove trailing comma
            $sql_query .= "\nWHERE $q" . 'id' . "$q = :update_id";
            $sql_query .= ";";

            try {
                //Run update query, collect stats
                $stmt = $this->db_connection->prepare($sql_query);
                if ($statement_params) {
                    foreach ($statement_params as $k => $v) {
                        $stmt->bindValue($k, $v);
                    }
                }

                $stmt->execute();
            } catch (Exception $ex) {
                Event::dispatch(EventData::forException($ex, $sql_query, $full_param_list));

                throw new QueryException($ex->getMessage(), $ex->getCode(), $ex);
            }

            $row_count = $stmt->rowCount();
            Event::dispatch(EventData::forAfter(Event::AFTER_UPDATE, $table_name, $full_param_list, $sql_query, $row_count));

            return $row_count;
        }
416429
public function rows(array $data): void
    {
        $this->rows = $data;
        $pdoStatement = $this->provideStatement();
        $this->execute($pdoStatement);
    }
1074148
public function add($key, $data)
    {
        $toInsert = $this->getDocumentData($data);

        $result = $this->collection->insertOne($toInsert);

        $data->_id = $result->getInsertedId();
    }
532245
public function write($id, $data)
    {
        try {
            return $this->db->write($id, $data);
        } catch (\Exception $e) {
            throw $e;
        }
    }
1314026
public function save(string $id, array $data)
    {
        $this->setFile($id);
        if ($this->file) {
            if (file_exists($this->file)) {
                $this->update($id, $data);
            } else {
                $this->add($id, $data);
            }
        }
    }
1214979
public function add(ActiveRecord $activeRecord, array $data = []): void
    {
        $this->collection[] = new Entity($activeRecord, $data);
    }
995260
public function add(array $data, $return_obj = false)
    {
        if (false === $this->has_table()) return false;

        if (empty($data)) {
            $this->set_error('No data to insert');
            return false;
        }

        if ($timestamp = $this->timestamp('creation')) {
            $data += $timestamp;
        }

        if (! $this->db->insert($this->table, $data)) {
            $this->set_error($this->db->error());
            return false;
        }

        $id = $this->db->insert_id();

        if ($return_obj) {
            return $this->get([$this->primary_key => $id], 1);
        }

        return $id;
    }
362533
public function addRow(GridRow $row)
    {
        if (!$this->rows->contains($row)) {
            $this->rows->add($row);
            $row->setQuestion($this);
        }
    }
579512
public function write($id, $data)
    {
        $writer = $this->db->getWriter();

        $data = [
            $this->options['data_col'] => $data,
            $this->options['time_col'] => (int) time(),
            $this->options['id_col'] => $id,
        ];

        $writer->updateOne($this->options['table'], $data, $this->options['id_col']);

        if ($writer->countAffected()) {
            return true;
        }

        $writer->insertOne($this->options['table'], $data, $this->options['id_col']);

        return true;
    }
1185502
public function update($id, array $data)
    {
        $this->validateId($id);

        $entity = $this->getById($id);
        $form   = $this->getEditForm();

        $form->bind($entity);
        $form->setData($data);

        if (!$valid = $form->isValid()) {
            return false;
        }

        $this->updateFromNode($entity);

        $this->getMapper()->save($entity);

        return $entity;
    }
1205536
public function getCellData($rowId, $columnId)
    {

        /* @var $columnData ColumnData */
        $columnData = $this->getColumnData($columnId);

        return $columnData->getCellData($rowId);
    }
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);
    }
317362
public function upsert($id, $data)
    {
        return $this->db->upsert($this->name, $id, $data);
    }
718667
function insertRow($row, $row_id = 0) {
        array_splice($this->_data, $row_id, 0, array($row));

        $this->_updateRowsCols($row);
    }