Insert On, insert one row in the table

@see insert
@param array $value

@return int
541311
private function insertOne(array $value)
    {
        $fields = array_keys($value);

        $sql = 'insert into `' . $this->table . '` values (';

        $sql .= implode(', ', Util::add2points($fields, true));

        $sql .= ');';

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

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

        $stmt->execute();

        return (int) $stmt->rowCount();
    }
697852
protected function generateArrayValue(array $value)
    {
        $value = $this->prepareArrayValue($value);
        $outputMode = count($value) > 1 ? $this->outputMode : self::OUTPUT_SINGLE_LINE;

        $code = 'array(';
        if ($outputMode === self::OUTPUT_MULTI_LINE) {
            $code .= $this->getLineFeed() . $this->getIndentation() . $this->getIndentationString() . $this->getIndentationString();
        }

        $outputParts = array();
        $noKeyIndex = 0;
        foreach ($value as $n => $v) {
            $v->setIndentationLevel($this->getIndentationLevel() + 1);
            $v->setOutputMode($this->outputMode);
            $partV = $v->generate();
            if ($n === $noKeyIndex) {
                $outputParts[] = $partV;
                $noKeyIndex++;
            } else {
                $outputParts[] = (is_int($n) === true ? $n : $this->escapeStringValue($n)) . ' => ' . $partV;
            }
        }

        if ($outputMode === self::OUTPUT_MULTI_LINE) {
            $padding = $this->getLineFeed() . $this->getIndentation() . $this->getIndentationString() . $this->getIndentationString();
        } else {
            $padding = ' ';
        }

        $code .= implode(',' . $padding, $outputParts);
        if ($outputMode === self::OUTPUT_MULTI_LINE) {
            $code .= $this->getLineFeed() . $this->getIndentation() . $this->getIndentationString();
        }
        $code .= ')';

        return $code;
    }
1281655
public function insert(array $values)
	{
		// Since every insert gets treated like a batch insert, we will make sure the
		// bindings are structured in a way that is convenient for building these
		// inserts statements by verifying the elements are actually an array.
		if ( ! is_array(reset($values)))
		{
			$values = array($values);
		}

		// Since every insert gets treated like a batch insert, we will make sure the
		// bindings are structured in a way that is convenient for building these
		// inserts statements by verifying the elements are actually an array.
		else
		{
			foreach ($values as $key => $value)
			{
				ksort($value); $values[$key] = $value;
			}
		}

		// We'll treat every insert like a batch insert so we can easily insert each
		// of the records into the database consistently. This will make it much
		// easier on the grammars to just handle one type of record insertion.
		$bindings = array();

		foreach ($values as $record)
		{
			$bindings = array_merge($bindings, array_values($record));
		}

		$sql = $this->grammar->compileInsert($this, $values);

		// Once we have compiled the insert statement's SQL we can execute it on the
		// connection and return a result as a boolean success indicator as that
		// is the same type of result returned by the raw connection instance.
		$bindings = $this->cleanBindings($bindings);

		return $this->connection->insert($sql, $bindings);
	}
114089
public function addValue($value)
        {
            if (is_array($value)) {
                foreach ($value as $single_value) {
                    $this->addValue($single_value);
                }
            } else {
                if ($value !== null) {
                    $this->values[] = $this->getDatabaseValue($value);
                }
            }
        }
564559
public function insert($offset, $value)
	{
		$offset = $this->normalizeKey($offset);
		$value  = $this->normalizeValue($value);

		// Insert the value at given offset. We put the value into an array so that array_splice()
		// won't insert it as multiple elements if it happens to be an array
		array_splice($this->items, $offset, 0, [$value]);

		return $value;
	}
1211230
public function insert(array $data): int
    {
        $this->builder->setInsertData($data);
        $sql = $this->builder->buildSql();
        $this->builder = new QueryBuilder($this->pdo);
        return $this->execSql($sql);
    }
950636
public function insert(array $values)
    {
        // Since every insert gets treated like a batch insert, we will have to detect
        // if the user is inserting a single document or an array of documents.
        $batch = true;

        foreach ($values as $value) {
            // As soon as we find a value that is not an array we assume the user is
            // inserting a single document.
            if (!is_array($value)) {
                $batch = false;
                break;
            }
        }

        if (!$batch) {
            $values = [$values];
        }

        // Batch insert
        $result = $this->collection->insertMany($values);

        return (1 == (int) $result->isAcknowledged());
    }
1069391
public function insert(array $values)
	{
		$start = microtime(true);

		// Since every insert gets treated like a batch insert, we will have to detect
		// if the user is inserting a single document or an array of documents.
		$batch = true;
		foreach ($values as $value)
		{
		    // As soon as we find a value that is not an array we assume the user is
		    // inserting a single document.
		    if (!is_array($value))
		    {
		        $batch = false; break;
		    }
		}

		if (!$batch) $values = array($values);

		// Batch insert
		$result = array();

		foreach ($values as $insert)
		{
			$result[] = $this->collection->insert($insert);
		}

		return $result;
	}
783090
public function setInternalValue($value)
    {
        if ($value instanceof \ArrayObject) {
            $value = $value->getArrayCopy();
        }

        if ($value instanceof \Iterator) {
            $value = iterator_to_array($value);
        }

        // force null values conversion to empty arrays
        if (is_null($value)) {
            $value = [];
        }

        if (!is_array($value)) {
            $value = [$value];
        }

        $this->clear();

        foreach ($value as $k => $v) {
            $this->set($k, $v);
        }

        return $this;
    }
297371
public function insert($values)
    {
        try {
            if (func_num_args() > 0 && !is_array($values)) {
                $this->values = array_merge($this->values, self::sanitizeAV(func_get_args()));
            } else if (is_array($values)) {
                $this->values = self::sanitize($values);
            } else {
                static::$response["status"] = "error";
                static::$response["response"] = "unrecognized parameter options in the insert values";
                static::$response["code"] = 7004;
                return static::terminate(static::$response);
            }
        } catch (Exception $e) {
            static::$response["status"] = "error";
            static::$response["response"] = $e->getMessage();
            static::$response["code"] = $e->getCode();
           return static::terminate(static::$response);
        }

        return $this;
    }
602243
public function append($value)
    {
        $nValue = (is_array($value) ? $value : [$value]);
        return $this->vUnion(new static($nValue));
    }
803235
public function add($value, array $attributes = null)
        {
            $cell = $value;
            if (is_string($value)) {
                $cell = new Cell($value, $attributes);
            }

            $this->_cells[] = $cell;

            return $this;
        }
1168669
public function pushCount($data, $value)
    {
        $index = count($this->map);
        $this->map[$index] = $data;
        for ($i = 0; $i < $value; $i++) {
            $this->randomArr[] = $index;
        }
    }
232948
public static function setColumn(array $matrix, $column, $value, $insertIfMissing = true, $overwrite = true)
    {
        // validate input
        if (self::countMinDepth($matrix) < 2) {
            throw new UnexpectedValueException('Can not set columns on one dimensional array');
        }
        if (!is_scalar($column)) {
            throw new InvalidArgumentException('Invalid column');
        }
        if (!is_bool($insertIfMissing)) {
            throw new InvalidArgumentException('Insert if missing indicator must be a boolean');
        }
        if (!is_bool($overwrite)) {
            throw new InvalidArgumentException('Overwrite indicator must be a boolean');
        }

        foreach ($matrix as $key => $row) {
            if (isset($row[$column]) || array_key_exists($column, $row)) {
                $matrix[$key][$column] = ($overwrite ? $value : $matrix[$key][$column]);
            } elseif ($insertIfMissing) {
                $matrix[$key][$column] = $value;
            }
        }

        return $matrix;
    }
50391
public function insertAndGetLastId(array $values)
    {
        $this->insert($values);

        $n = $this->connection->lastInsertId();

        return $n;
    }
123076
protected function insertValue($value): void
    {
        // Grab the top item from the stack that we're currently parsing.
        $currentItem = array_pop($this->stack);

        // Examine the current item, and then:
        //   - if it's an object, associate the newly-parsed value with the most recent key
        //   - if it's an array, push the newly-parsed value to the array
        if ('object' === $currentItem['type']) {
            $currentItem['value'][array_pop($this->keys)] = $value;
        } else {
            $currentItem['value'][] = $value;
        }

        // Replace the current item on the stack.
        $this->stack[] = $currentItem;
    }
58951
public function setFrom($value)
    {
        if (is_array($value)) {
            $value = new Person($value);
        }
        return $this->setParameter('from', $value);
    }