Set insert stament
@param string $table
@param array $updateFields
@return \Puja\SqlBuilder\Builder
543244
public function insert($table, array $updateFields)
    {
        $this->queryTypeProcess(self::QUERYTYPE_INSERT, $table, $updateFields);
        //$this->fields = $updateFields;
        return $this;
    }
636435
public function insert(string $table, $data=[]): ?PDOStatement
	{
		if ( ! empty($data))
		{
			$this->set($data);
		}

		return $this->_run('insert', $table);
	}
9723
public static function insert($table, $data) {
        $insert = Insert::table($table);
        foreach ($data as $field => $value) {
            $insert->set($field, $value);
        }
        return $insert->excuse();
    }
595188
public function setTable($table) {

		if(false === is_string($table)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($table)), E_USER_ERROR);
		}

		$this -> table = $table;

		return $this;
	}
1088754
public function setTable($table){

		//put this in try...catch block for better error handling
		try{

			//check if from is empty
			if ( empty($table)) 
			{
				//throw new exception
				throw new MySQLException("Invalid argument passed for table name", 1);

			}

		}

		//diplay error message
		catch(MySQLException $MySQLExceptionObject){

			//display error message
			$MySQLExceptionObject->errorShow();

		}		

		//set the protected $from value
		$this->froms = $table;
		if(!isset($this->fields[$table])) $this->fields[$table] = array("*");
		return $this;
			
	}
635283
public function buildQuery(string $table, array $set, array $where): SqlParams
    {
        if (empty($set) || empty($where)) {
            throw new \Exception('Set and where arrays cannot be empty');
        }

        $params = [];
        $sql = "UPDATE {$table} SET ";

        foreach ($set as $column => $value) {
            $sql .= $this->options->escapeIdentifier($column) . ' = ?, ';
            $params[] = $value;
        }

        $sql = substr_replace($sql, '', -2); // remove trailing comma
        $whereClause = $this->buildWhereClause($where);
        $sql .= $whereClause->getSql();

        return new SqlParams($sql, array_merge($params, $whereClause->getParams()));
    }
588479
public function insert($table, array $columns)
    {
        if (empty($columns)) {
            return 0;
        }
        return $this->getInsertBuilder()
            ->setTable($table)
            ->setColumns($columns)
            ->execute();
    }
498161
public function into($table)
    {
        $this->_dirty();
        $this->_type = 'insert';
        $this->_parts['insert'][0] = $table;

        return $this;
    }
1194233
public function insert($table, $ignore = false)
	{
		$this->syntax->setInsert($table, $ignore);
		$this->type = 'insert';
		return $this;
	}
864536
protected function prepareInsert($table, $values){
        $sql= 'INSERT INTO ' . $table . ' (';
        $value= 'values(';
        foreach ($values as $key => $val) {
            $sql.= $key . ',';
            $value.= ':' . $key . ',';
        }
        $sql = trim($sql, ',');
        $value = trim($value, ',');
        $sql .= ') ' . $value . ')';
        //Preparo la consulta y la retorno
        return $this->connection->prepare($sql);
    }
1115659
public function updateRows(string $table, array $set, array $where): int
    {
        $update = new Update($this->options);
        $sqlParams = $update->buildQuery($table, $set, $where);
        return $this->query($sqlParams->getSql(), $sqlParams->getParams())->getAffected();
    }
102419
public function insert(string $table): Query\Insert
    {
        $query = new Query\Insert();
        $query->insert($table);
        return $query;
    }
205835
public function update( $table )
    {
        $table = $this->getIdentifier( $table );
        $table = $this->getPrefixedTableNames($table);
        $this->table = $table;
        return $this;
    }
643802
public function insert($table, array $fields)
    {
        $keys = array_keys($fields);
        $values = array_values($fields);

        $replace = function() { return '?'; };

        $marks = array_map($replace, $keys);

        $key = implode(',', $keys);
        $mark = implode(',', $marks);

        $sql = "INSERT INTO {$table} ($key) VALUES ($mark)";

        $result = $this->query($sql, $values);

        $identity = $this->selectOne("SELECT @@IDENTITY as IDENTITY");
        if (empty($identity)) {
            return $result;
        } else {
            return $identity->IDENTITY;
        }
    }
212200
public function insert($table, array $values = null)
    {
        $builder         = new Insert($this->driver);
        $this->lastQuery = $builder;

        if ($values) {
            $builder->values($values);
        }

        return $builder->into($table);
    }
1076718
public function set($field, $value = null , $insert = true, $update = true)
    {

        if (is_array($field)) {
            foreach ($field as $key=>$val) {
                $this->set($key, $val, $insert, $update);
            }
        }

        $this->add($field, '', 'auto');
        if ($insert)
            $this->field($field)->insertValue($value);

        if ($update)
            $this->field($field)->updateValue($value);

    }
622876
public function insertOrUpdate($table, array $set, array $where)
    {
        if ($this->select($table, $where)) {
            $result = $this->update($table, $set, $where);
        } else {
            $params = array_merge($where, $set);
            $result = $this->insert($table, $params);
        }

        return $result;
    }