Insert a row into batch.
@param  array $row
@return boolean    return true when a batch is inserted
352871
public function insertBatch(array $row) {
		$this->batch[] = $row;
		if(count($this->batch) >= $this->batch_size) {
			$this->flushBatch();
			return true;
		}
		return false;
	}
1363936
public function inserts(array $rows): ?bool
    {
        //逐行执行前置钩子
        foreach ($rows as $key => $row) {
            //增加自动字段
            $row = self::appendAutoField($row);

            //执行前置钩子
            $ret = $this->before('Insert', 'Insert', $row);

            //前置钩子失败,不执行插入操作
            if ($ret === self::INTERRUPT) {
                return null;
            }
            $rows[$key] = array_pop($ret);
        }

        //记录信息
        $this->statement->inserts($rows);

        //执行操作,并记录日志
        self::log('inserts', $rows, '', '', false, false);

        //多行插入,无法执行后置钩子
        return true;
    }
110678
public function append(array $row): void
    {
        if ($this->returnType === self::TYPE_ARRAYOBJECT) {
            $this->storage[] = new ArrayObject($row);
        } else {
            $this->storage[] = $row;
        }
        ++$this->count;
    }
381996
function insert( $rows, $method = null ) {

        return $this->db->insert( $this->table, $rows, $method );

    }
328219
private function processInsertIgnore2(array $row): int
    {
        self::execute2();

        // 获取新记录的主键
        $id = $this->getInsertedId();
        if ($id) {
            //已经有ID了,什么都不做
            return intval($id);
        }

        if (isset($row['id'])) {
            // 取记录中的ID
            return intval($row['id']);
        }

        //已经存在时返回0
        return 0;
    }
1293499
public function beforeInsert(Row $row): void
    {
        foreach ($row->values() as $column => $value) {
            if (null !== $value) {
                $row->changeColumnValue($column, $this->parseKeyIfNeeded($value));
            }
        }
    }
976730
protected function _insert(array $data = array())
    {
        if (!is_null($this->_table)) {
            $this->_affectedRows = $this->_db->insert($this->_table, $data);
            if ($this->_affectedRows > 0) {
                $this->id = $this->_db->lastInsertId();
            }
            return $this->_affectedRows;
        }
    }
512808
private function updateBoundColumns(array $row)
    {
        foreach ($this->columnBinding as $column => &$metadata) {
            $index = $this->collection->getColumnIndex($column);
            if ($index === null) {
                // todo: I would like to throw an exception and tell someone they screwed up
                // but i think that would violate the PDO api
                continue;
            }

            // Update by reference
            $value           = $this->typedValue($row[$index], $metadata['type']);
            $metadata['ref'] = $value;
        }
    }
1068026
protected function put(array $row)
    {
        if (defined('HHVM_VERSION') === true) {
            $result = fputcsv(
                $this->csv,
                $row,
                $this->getConfig('delimiter'),
                $this->getConfig('quote')
            );
        } else {
            $result = fputcsv(
                $this->csv,
                $row,
                $this->getConfig('delimiter'),
                $this->getConfig('quote'),
                $this->getConfig('escape')
            );
        }
        // It's not trivial to measure how many bytes we should have written,
        // so we'll just ensure we have at least one per element.
        if ($result === false || $result < count($row)) {
            throw new \RuntimeException('Unable to write to output file.');
        }
        return $result;
    }
421888
public function put($data)
    {
        if (empty($data) or !is_array($data))
        {
            return false;
        }
        if ($this->db->insert($data, $this->table))
        {
            $lastInsertId = $this->db->lastInsertId();
            if ($lastInsertId == 0)
            {
                return true;
            }
            else
            {
                return $lastInsertId;
            }
        }
        else
        {
            return false;
        }
    }
32056
private function passesFilter(array $row)
    {
        foreach ($row as $name => $value) {
            if (isset($this->rules[$name])) {
                // check all rules for a given attribute
                foreach ($this->rules[$name] as $rule) {
                    /* @var $rule MatcherInterface */
                    if (!$rule->match($value)) {
                        return false;
                    }
                }
            }
        }

        return true;
    }
637738
private function createBottomHeadingRow(array $rows)
    {
        $elements = array();

        if ($this->options[self::GRID_PARAM_BATCH] === true) {
            $elements[] = $this->createColumn(null, null);
        }

        foreach ($rows as $row) {
            // Ignore if configuration for current column isn't provided
            if (!$this->hasColumnConfiguration($row[self::GRID_PARAM_COLUMN])) {
                continue;
            }

            // Find out whether a column needs to have a filter
            $filter = $this->findOptionByColumn($row[self::GRID_PARAM_COLUMN], self::GRID_PARAM_FILTER);

            // Use provided name if available, otherwise name it as a column
            $inputName = isset($row[self::GRID_PARAM_NAME]) ? $row[self::GRID_PARAM_NAME] : $row[self::GRID_PARAM_COLUMN];

            // Full-qualified input name
            $name = $this->createInputName(self::GRID_PARAM_FILTER, $inputName);

            if ($filter) {
                // If filter is array, then assume its for select
                $selected = $this->filter->get($inputName);

                if (is_array($filter)) {
                    $filter = array_replace(array('' => ''), $filter);
                    $elements[] = $this->createInput('createHeader', $row[self::GRID_PARAM_COLUMN], $name, $selected, $filter);
                    // If explicit boolean filter provided
                } else if ($filter === 'boolean') {
                    $options = array(
                        '0' => 'No',
                        '1' => 'Yes'
                    );

                    // Translate boolean values on demand
                    if ($this->hasTranslator()) {
                        $options = $this->translator->translateArray($options);
                    }

                    $filter = array_replace(array('' => ''), $options);
                    $elements[] = $this->createInput('createHeader', $row[self::GRID_PARAM_COLUMN], $name, $selected, $filter);
                    
                } else {
                    $elements[] = $this->createInput('createHeader', $row[self::GRID_PARAM_COLUMN], $name, $selected);
                }

            } else {
                $elements[] = $this->createColumn(null, '');
            }
        }

        if ($this->hasActions()) {
            $elements[] = $this->createTextHeader('');
        }

        return $this->createTableRow($elements);
    }
85654
protected function checkRow(array $row) {
		foreach ($row as $column => $str) {
			$width = Colors::width( $str, $this->isAsciiPreColorized( $column ) );
			if (!isset($this->_width[$column]) || $width > $this->_width[$column]) {
				$this->_width[$column] = $width;
			}
		}

		return $row;
	}
839827
public function add_data($row) {
        if(!isset($this->path)) {
            $this->set_temp_file_path();
            $this->fp = fopen($this->path, 'w+');
        }
        $delimiter = csv_import_reader::get_delimiter($this->delimiter);
        fputcsv($this->fp, $row, $delimiter, $this->csvenclosure);
    }
1036956
private function getJobFromRow(array $row)
    {
        $type = $row['type'];

        /** @var Job $job */
        $job = new $type($this->jsonDecode($row['data']));
        $job->setChannel($row['channel']);
        $job->setBatchId($row['batch_id']);
        $job->setQueue($this, (integer) $row['id']);

        return $job;
    }
89434
public function result($row = 0)
    {
        return isset($this->results[$row]) ? $this->results[$row] : false;
    }
422832
protected function loadRow(array $row) {
        $settings = \json_decode($row['settings'], true);
        if($settings === null) {
            $this->client->emit('warn', 'MySQLProvider couldn\'t parse the settings stored for guild "'.$row['guild'].'". Error: '.\json_last_error_msg());
            return;
        }
        
        $settings = new \ArrayObject($settings, \ArrayObject::ARRAY_AS_PROPS);
        $this->settings->set($row['guild'], $settings);
        
        try {
            $this->setupGuild($row['guild']);
        } catch (\InvalidArgumentException $e) {
            $this->settings->delete($row['guild']);
            $this->runQuery('DELETE FROM `settings` WHERE `guild` = ?', array($row['guild']))->done(null, array($this->client, 'handlePromiseRejection'));
        }
    }