• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/sqlwhere.php
  • Класс: CSQLWhereExpression
  • Вызов: CSQLWhereExpression::execPlaceholders
protected function execPlaceholders($matches)
{
	$this->i++;

	$id = $matches[1];

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

		if ($id == '?' || $id == '?s')
		{
			return "'" . $this->DB->ForSql($value) . "'";
		}
		elseif ($id == '?#')
		{
			$connection = BitrixMainApplication::getConnection();
			$helper = $connection->getSqlHelper();

			return $helper->quote($value);
		}
		elseif ($id == '?v')
		{
			$connection = BitrixMainApplication::getConnection();
			$helper = $connection->getSqlHelper();

			return $helper->values($value);
		}
		elseif ($id == '?i')
		{
			return (int) $value;
		}
		elseif ($id == '?f')
		{
			return (float) $value;
		}
	}

	return $id;
}