Creates an INSERT query.

@param array $values insert values

@return \JAQB\Query\InsertQuery
761481
public function insert(array $values)
    {
        $query = new Query\InsertQuery();

        if ($this->pdo) {
            $query->setPDO($this->pdo);
        }

        return $query->values($values);
    }
1314956
public function add( array $values )
	{
		$this->baskets[$this->type] = $this->get()->fromArray( $values );
		return $this;
	}
791633
public function insertRow(array $values)
    {
        try {
            return $this->innerGateway->insertRow($values);
        } catch (DBALException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        }
    }
32448
public function insertGetId(array $values, $sequence = null)
    {
        $this->compileWheres();
        $result = $this->query->insert($values);

        if (0 == (int) $result['errors']) {
            if (isset($values['id'])) {
                return $values['id'];
            }

            // Return id
            return current($result['generated_keys']);
        }
    }
227490
public function createItem( array $values = [] )
	{
		$values['customer.siteid'] = $this->getContext()->getLocale()->getSiteId();
		return $this->createItemBase( $values );
	}
841752
public function insertGetId(array $values): string
    {
        $stmt = $this->set($values)->prepare();
        $stmt->execute();

        return $this->pdo->lastInsertId();
    }
930597
public function insertGetId(array $values, $sequence = null)
    {
        $sql = $this->grammar->compileInsertGetId($this, $values, $sequence);

        $values = $this->cleanBindings($values);

        return $this->processor->processInsertGetId($this, $sql, $values, $sequence);
    }
1081830
function insert($tableName, $columns, $values = null)
  {
    // Three possibilities
    // string[string] columns, null
    // string[] columns, string[] values
    // string[] columns, string[][] values

    if ($values === null)
    {
      $values = array_values($columns);
      $columns = array_keys($columns);
    }

    $query = "insert into $tableName (`".implode("`,`",$columns)."`) values ";
    if (!is_array($values[0]))
      $query .= "(".$this->quote($values).")";
    else
      $query .= $this->quote($values);
//    {
//      $query .= implode(",",array_map([$this,"quote"],$values));
//    }
//    else
//    {
//      $query .= implode("),(",array_map(function($a){ return implode(",",array_map([$this,"quote"],$a));},$values));
//    }

    $this->q($query);
    return $this->insert_id;
  }
213847
public function addValues(array $values)
    {
        $valueReferences = [];

        foreach ($values as $value) {
            $valueReferences[] = $this->getReferences()->createReference($value);
        }

        $this->values[] = $valueReferences;

        return $this;
    }
1258032
public function setValues(array $values)
    {
        foreach ($values as $name => $value) {
            $this->fields->set($name, $value);
        }

        return $this;
    }
906111
public function addSets(array $values = array())
    {
        foreach ($values as $column => $value) {
            $this->addSet($column, $value);
        }

        return $this;
    }
132950
public function dbgUpdate(array $values) {
		$sql = $this->buildUpdateSQL($values);
		$params = $this->getParameters();

		return $this->replaceParams($sql, $params);
	}
587032
public function insert(array $values): ResultInterface
    {
        $this->insert                   = $this->getTableName();
        $this->insertValues['columns']  = array_keys($values);
        $this->insertValues['values'][] = array_values($values);

        return $this->execute();
    }
633943
protected function insertValues(array $values) : void
    {
        if (count($values) > 0) {
            foreach ($values as $k => $v) {
                $this->set((string)$k, $v);
            }
        }
    }
900883
public function insert($columns) {
        // Check if array is associative
        if (Arr::is_assoc($columns)) {
            // Get array keys
            $arr_keys = array_keys($columns);

            // Get array values
            $arr_values = array_values($columns);

            $values = '';
            $fields = '';
            $insert  = [];

            // Build up the insert query
            $this->q->apd('INSERT INTO ' . $this->table_name . '(');

            for ($ii = 0; $ii < count($arr_keys); $ii++) {
                if ($ii != count($arr_keys) -1) {
                    $fields .= $arr_keys[$ii] . ', ';

                    if (!$this->is_SQL_function($arr_values[$ii])) {
                        $values .= ':' . $arr_keys[$ii] . ', ';
                        $insert[':' . $arr_keys[$ii]] = $arr_values[$ii];
                    } else {
                        $values .= $arr_values[$ii] . ', ';
                    }
                } else {
                    $fields .= $arr_keys[$ii] . ') VALUES (';

                    if (!$this->is_SQL_function($arr_values[$ii])) {
                        $values .= ':' . $arr_keys[$ii] . ')';
                        $insert[':' . $arr_keys[$ii]] = $arr_values[$ii];
                    } else {
                        $values .= $arr_values[$ii] . ')';
                    }
                }
            }

            // Finalize query
            $this->q->apd($fields . $values);

            try {
                $query = $this->db->prepare($this->q->get());
                $query->execute($insert);
                $this->clear();

                // Set last inserted id
                $this->lastInsertId = $this->db->lastInsertId();

                return true;
            } catch (\PDOException $e) {
                $this->setError('d', $e->getMessage());
                return false;
            }
        } else {
            echo 'Wrong array format';
            return false;
        }
    }
541487
public function setResults(array $values)
    {
        foreach ($values as $field => $value) {
            if (empty($value)) {
                continue;
            }
            $this->setResult($field, $value);
        }

        return $this;
    }
1293599
protected function insert(array $values, array $place_holders = [], $table = ''){
        if( empty($table) ){
            extract($this->get_default_values($values, $table, $place_holders));
        }
        return $this->db->insert($table, $values, $place_holders);
    }