Binds parameter to the prepared statement.

@param \PDOStatement $statement PDO statement
@param int           $key       Parameter key
@param mixed         $value     Parameter value
554201
protected function bindParameter(PDOStatement $statement, int $key, $value): void
	{
		if(is_string($value))
		{
			$type = PDO::PARAM_STR;
		}
		elseif(is_int($value))
		{
			$type = PDO::PARAM_INT;
		}
		elseif(is_bool($value))
		{
			$type = PDO::PARAM_BOOL;
		}
		elseif(is_null($value))
		{
			$type = PDO::PARAM_NULL;
		}
		elseif(is_object($value) && $value instanceof TypeInterface)
		{
			$value = $value->getValue();

			$type = $value->getType();
		}
		elseif(is_resource($value))
		{
			$type = PDO::PARAM_LOB;
		}
		else
		{
			$type = PDO::PARAM_STR;
		}

		$statement->bindValue($key + 1, $value, $type);
	}
23134
protected function bindParameter(\PDOStatement $stmt, $params, $types)
    {
        !is_array($params) && $params = array($params);
        !is_array($types) && $types = array($types);

        $isIndex = is_int(key($params));
        $index = 1;

        foreach ($params as $name => $param) {
            // Number index parameters
            if ($isIndex) {
                if (isset($types[$index - 1])) {
                    $stmt->bindValue($index, $param, $types[$index - 1]);
                } else {
                    $stmt->bindValue($index, $param);
                }
                $index++;
            // Named parameters
            } else {
                if (isset($types[$name])) {
                    $stmt->bindValue($name, $param, $types[$name]);
                } else {
                    $stmt->bindValue($name, $param);
                }
            }
        }
    }
918027
protected function setKey($key, $value)
    {
        if ($key == $this->_keyName) {
            $this->_keyValue = $value;
            $this->_key['value'] = $value;
        }
    }
724027
public function dumpSQL(\PDOStatement $statement = null) {
        if ($statement) {
            @ob_start(PHP_OUTPUT_HANDLER_CLEANABLE);
            $statement->debugDumpParams();
            $this->dumpSQL = @ob_get_clean();

            return null;
        } else {
            return $this->dumpSQL;
        }
    }
1021811
protected function provideStatement(): \PDOStatement
    {
        $sqlStatement = $this->buildStatement();
        $bindingValues = $this->statementBuilder->getBindingValues();
        return $this->prepareStatement($sqlStatement, $bindingValues);
    }
1279013
public function setParam(string $key, $value): Mapping
    {
        $this->_mapping[$key] = $value;

        return $this;
    }
421547
public function bindValue($parameter, $value, $type = \PDO::PARAM_STR)
    {
        list($value, $type) = TypeUtility::convertToDatabase($value, $type, $this->connection->getPlatform());

        return $this->getDriverStatement()->bindValue($parameter, $value, $type);
    }
663194
protected function addStatement(string $key, $value): void
    {
        if (array_key_exists($key, $this->statements) === false) {
            $this->statements[$key] = (array)$value;
        } else {
            $this->statements[$key] = array_merge($this->statements[$key], (array)$value);
        }
    }
1361925
public function bindValues($statement, $bindings)
    {
        foreach ($bindings as $key => $value) {
            $statement->bindParam($key, $bindings[$key]);
        }
    }
1082652
private function binding(\PDOStatement $sql, array $bindings = []): \PDOStatement
    {
        foreach ($bindings as $binding=>$value) {
            if (!is_array($value)) {
                $sql->bindValue($binding, $value);
            } else {
                switch(strtolower($value[1])) {
                    case 'date':
                        $sql->bindValue($binding, $this->time($value[0], 'Y-m-d'), \PDO::PARAM_STR);
                        break;
                    case 'time':
                        $sql->bindValue($binding, $this->time($value[0], 'Y-m-d H:i:s.u'), \PDO::PARAM_STR);
                        break;
                    case 'bool':
                    case 'boolean':
                        $sql->bindValue($binding, boolval($value[0]), \PDO::PARAM_BOOL);
                        break;
                    case 'null':
                        $sql->bindValue($binding, NULL, \PDO::PARAM_NULL);
                        break;
                    case 'int':
                    case 'integer':
                    case 'number':
                    case 'limit':
                    case 'offset':
                        $sql->bindValue($binding, intval($value[0]), \PDO::PARAM_INT);
                        break;
                    case 'str':
                    case 'string':
                    case 'text':
                    case 'float':
                    case 'varchar':
                    case 'varchar2':
                        $sql->bindValue($binding, strval($value[0]), \PDO::PARAM_STR);
                        break;
                    case 'lob':
                    case 'large':
                    case 'object':
                    case 'blob':
                        $sql->bindParam($binding, $value[0], \PDO::PARAM_LOB, strlen($value[0]));
                        break;
                    case 'like':
                        $sql->bindValue($binding, '%'.$value[0].'%', \PDO::PARAM_STR);
                        break;
                    default:
                        if (is_int($value[1])) {
                            $sql->bindValue($binding, $value[0], $value[1]);
                        } else {
                            $sql->bindValue($binding, strval($value[0]), \PDO::PARAM_STR);
                        }
                }
            }
        }
        return $sql;
    }
940769
public function withQueryParam($key, $value)
    {
        $params = $this->getQueryParams();
        $params[$key] = $value;
        $this->queryParams = $params;
    }
471434
private function bind($key, $value, $bindDataType)
    {
        $this->sqlQuery->bindValue($key, $value, $bindDataType);
    }
252432
final public static function set($key, $value)
	{
		self::_checkInstance();
		self::$_instance->offsetSet($key, $value);
	}
1276551
private function prepareRowOperator(?string $operator, $value, int $key): string
    {
        if (!$operator) {
            $operator = is_array($value) ? 'IN' : '=';
        }

        if ($operator === 'IN' and !is_array($value)) {
            if ($key !== 0) {
                throw new SqlException('Row value should be an array in condition on key #' . $key . '.');
            }

            $operator = '=';
        }

        if ($operator !== 'IN' and is_array($value)) {
            throw new SqlException('Row value could not be an array in condition on key #' . $key . ' for operator `' . $operator . '`.');
        }

        return $operator;
    }
32848
public function setParam($key, $value)
    {
        if (!array_key_exists($key, $this->getParams())) {
            throw new \Exception("Invalid param '$key' given.");
        }

        $this->params[$key] = $value;
    }
1369751
public function bind($key, $value = null)
    {
        $data = $key;

        if (!is_array($key)) {
            $data = array($key => $value);
        }

        foreach ($data as $key => $value) {
            $this->binds[$key] = $value;
        }

        return $this;
    }
1362423
public static function executeStatement(
        PDOStatement $statement,
        array $params = null
    ) {
        //Add the statement to the list of those run
        static::addStatement($statement);

        //Add bindings to the statement
        if (is_array($params)) {
            $statement->getBindings()
                ->hydrateFromArray($params);
        }

        $result = static::getOrCreateResultAt(static::numQueries());

        //Add the result to the statement
        $statement->setResult($result);

        //If a transaction is open, add the statement to it
        if (static::inTransaction()) {
            static::currentTransaction()->addStatement($statement);
        }

        //Increment number of queries run
        static::incrementNumQueries();

        if (static::shouldLogBacktrace()) {
            $statement->setBacktrace(
                static::makeBacktraceCollection(
                    debug_backtrace(
                        DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS,
                        static::resolveBacktraceLimit()
                    )
                )
            );
        }
    }