Returns bindings for the given clause and values.

@param string $clause
@param array $values
@return array bindings for the given clause and values.
541225
private function addBindings($clause, array $values)
	{
		$result = [];

		foreach ($values as $key => $value) {
			$result[$key] = $this->addBinding($clause, $value);
		}

		return $result;
	}
1002087
public function compileReplace(Builder $query, array $values)
    {
        // Essentially we will force every insert to be treated as a batch insert which
        // simply makes creating the SQL easier for us since we can utilize the same
        // basic routine regardless of an amount of records given to us to insert.
        $table = $this->wrapTable($query->from);

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

        $columns = $this->columnize(array_keys(reset($values)));

        // We need to build a list of parameter place-holders of values that are bound
        // to the query. Each insert should have the exact same amount of parameter
        // bindings so we will loop through the record and parameterize them all.
        $parameters = [];

        foreach ($values as $record) {
            $parameters[] = '('.$this->parameterize($record).')';
        }

        $parameters = implode(', ', $parameters);

        return "replace into $table ($columns) values $parameters";
    }
346476
protected function buildConstraints($values)
    {
        if (is_array($values)) {
            $constraints = [];
            foreach ($values as $value) {
                $constraints[] = Constraint::make($value);
            }
            return $constraints;
        } else {
            return Constraint::make($values);
        }
    }
310398
public function getExecutedQueryString(array $values = array())
    {
        $sql = $this->queryString;
        $boundValues = empty($values) ? $this->boundValues : $values;
        $matches = array();
        if (preg_match_all('/(:p[0-9]+\b)/', $sql, $matches)) {
            $size = count($matches[1]);
            for ($i = $size - 1; $i >= 0; $i--) {
                $pos = $matches[1][$i];

                // trimming extra quotes, making sure value is properly quoted afterwards
                $boundValue = $boundValues[$pos];
                if (is_string($boundValue)) { // quoting only needed for string values
                    $boundValue = trim($boundValue, "'");
                    $boundValue = $this->pdo->quote($boundValue);
                }
                $sql = str_replace($pos, $boundValue, $sql);
            }
        }

        return $sql;
    }
291265
public function addWhereIn(string $column, array $values)
    {
        foreach ($values as $value) {  // pour bindValue(s)
            $this->wheresIn[][2] = $value;
        }

        $this->sql['where'] .= " ".$this->logicOperator." ".$column." IN ".$this->addConditionsToSqlWhithWhereIn()." ";

        $this->logicOperator = " AND ";
    }
124385
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 when building these
        // inserts statements by verifying these elements are actually an array.
        if (empty($values)) {
            return true;
        }

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

        // Here, we will sort the insert keys for every record so that each insert is
        // in the same order for the record. We need to make sure this is the case
        // so there are not any errors or problems when inserting these records.
        else {
            foreach ($values as $key => $value) {
                ksort($value);

                $values[$key] = $value;
            }
        }

        // Finally, we will run this query against the database connection and return
        // the results. We will need to also flatten these bindings before running
        // the query so they are all in one huge, flattened array for execution.
        $compiledInsert = $this->grammar->compileInsert($this, $values);

        return $this->connection->insert(
            $compiledInsert,
            $this->cleanBindings(Arr::flatten($values, 1))
        );
    }
9021
public function bindValues(
        /*# string */ $sql,
        array &$bindings,
        array $settings
    )/*# : string */ {
        // make sure escape function ok
        $this->setEscapeCallable($settings['escapeFunction']);

        // replace each placeholder with corresponding ?/:name/value
        return preg_replace_callback(
            '/\b__PHQUERY_[^_]++__\b/',
            function ($m) use (&$bindings, $settings) {
                return $this->replacePlaceholders($m[0], $bindings, $settings);
            },
            $sql
        );
    }
454607
public function getWhereArray(array $clauses, array $options = [])
    {
        $query = $this->createBaseBuilder($options);

        $this->applyWhereArray($query, $clauses);

        return $query->get();
    }
343326
public function bindValues($values)
    {
        foreach($values as $k => $v)
        {
            $this->binds[$k] = $v;
        }
        return $this;
    }
292893
private function prepareQueryBinding(array $binding)
    {
        $value = $binding['value'];

        list ($type, $val) = $this->toGrpcValue($value);

        $binding['value'][$type] = $val;

        return $binding;
    }
1151077
public function bindValues(array $bind_values)
    {
        foreach ($bind_values as $key => $val) {
            $this->bindValue($key, $val);
        }
        return $this;
    }
370042
public function clear($clause=null)
  {
    switch($clause){
      case 'select':
        $this->select = null;
        $this->type   = null;
        break;

      case 'delete':
        $this->delete = null;
        $this->type   = null;
        break;

      case 'update':
        $this->update = null;
        $this->type   = null;
        break;

      case 'insert':
        $this->insert = null;
        $this->type   = null;
        $this->autoIncrementField = null;
        break;

      case 'from':
        $this->from = null;
        break;

      case 'join':
        $this->join = null;
        break;

      case 'set':
        $this->set = null;
        break;

      case 'where':
        $this->where = null;
        break;

      case 'group':
        $this->group = null;
        break;

      case 'having':
        $this->having = null;
        break;

      case 'order':
        $this->order = null;
        break;

      case 'columns':
        $this->columns = null;
        break;

      case 'values':
        $this->values = null;
        break;

      default:
        $this->type               = null;
        $this->select             = null;
        $this->delete             = null;
        $this->update             = null;
        $this->insert             = null;
        $this->from               = null;
        $this->join               = null;
        $this->set                = null;
        $this->where              = null;
        $this->group              = null;
        $this->having             = null;
        $this->order              = null;
        $this->columns            = null;
        $this->values             = null;
        $this->autoIncrementField = null;
        break;
    }

    return $this;
  }
37139
protected function addClauseCondWithBind($clause, $andor, $conditions)
    {
        $cond = array_shift($conditions);
        $cond = $this->quoteNamesIn($cond);

        $bind =& $this->{"bind_{$clause}"};
        foreach ($conditions as $value) {
            $bind[] = $value;
        }

        $clause =& $this->$clause;
        if ($clause) {
            $clause[] = "$andor $cond";
        } else {
            $clause[] = $cond;
        }
    }
924001
public function filter($values)
    {
        if (is_array($values)) {
            foreach ($values as $key => $value) {
                $values[$key] = $this->filterValue($value);
            }
        }

        return $values;
    }
1245490
public function fetchPairs(string $statement, array $bindings = []): array
    {
        $sth = $this->execute($statement, $bindings);

        $result = $sth->fetchAll(PDO::FETCH_KEY_PAIR);

        $this->freeResource($sth);

        return $result;
    }
1071588
public function addBinding($field, $values) {
        if (!is_array($values)) {
            $values = [$values];
        }

        foreach ($values as $value) {
            if ($value instanceof Predicate) {
                $this->resolvePredicate($value);

            } else if ($value instanceof SubQuery) {
                $this->resolveSubQuery($value);

            } else {
                $this->_bindings[] = [
                    'field' => $field,
                    'value' => $value
                ];
            }
        }

        return $this;
    }
779770
public function filterValues(array $values = null)
    {
        if (null === $values) {
            $values = $this->getFields();
        }
        foreach ($values as $key => $value) {
            $values[$key] = $this->filterValue($value);
        }
        return $values;
    }