function NamedPlaceholderConverter::addPositionalParameter
Adds a positional placeholder to the converted parts.
Normally Drupal does not produce SQL with positional placeholders, but this is to manage the edge case.
Parameters
string $sql: The SQL part.
1 call to NamedPlaceholderConverter::addPositionalParameter()
- NamedPlaceholderConverter::parse in core/
modules/ mysqli/ src/ Driver/ Database/ mysqli/ NamedPlaceholderConverter.php - Parses an SQL statement with named placeholders.
File
-
core/
modules/ mysqli/ src/ Driver/ Database/ mysqli/ NamedPlaceholderConverter.php, line 190
Class
- NamedPlaceholderConverter
- A class to convert a SQL statement with named placeholders to positional.
Namespace
Drupal\mysqli\Driver\Database\mysqliCode
private function addPositionalParameter(string $sql) : void {
$index = $this->originalParameterIndex;
if (!array_key_exists($index, $this->originalParameters)) {
throw new \RuntimeException('Missing Positional Parameter ' . $index);
}
$this->convertedSQL[] = '?';
$this->convertedParameters[] = $this->originalParameters[$index];
$this->originalParameterIndex++;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.