• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/db/sqlexpression.php
  • Класс: BitrixMainDBSqlExpression
  • Вызов: SqlExpression::execPlaceholders
protected function execPlaceholders($matches)
{
	$sqlHelper = $this->getConnection()->getSqlHelper();

	$this->i++;

	$pre = $matches[1];
	$ph = $matches[2];

	if (array_key_exists($this->i, $this->args))
	{
		$value = $this->args[$this->i];

		if ($value === null && $ph !== '?#')
		{
			$value = 'NULL';
		}
		elseif ($ph == '?' || $ph == '?s')
		{
			$value = "'" . $sqlHelper->forSql($value) . "'";
		}
		elseif ($ph == '?#')
		{
			$value = $sqlHelper->quote($value);
		}
		elseif ($ph == '?v')
		{
			$value = $sqlHelper->values($value);
		}
		elseif ($ph == '?i')
		{
			$value = (int) $value;
		}
		elseif ($ph == '?f')
		{
			$value = (float) $value;
		}

		return $pre . $value;
	}

	return $matches[0];
}