См. определение в файле sqlexpression.php строка 18
◆ __construct()
- Аргументы
-
string | $expression | Sql expression. |
| string,... | $args Substitutes. |
- Исключения
-
См. определение в файле sqlexpression.php строка 39
41 $args = func_get_args();
45 throw new \Bitrix\Main\ArgumentException(
'No pattern has been found for SqlExpression');
48 $this->expression =
$args[0];
◆ __toString()
См. определение в файле sqlexpression.php строка 132
compile()
Returns $expression with replaced placeholders.
◆ compile()
Returns $expression with replaced placeholders.
- Возвращает
- string
См. определение в файле sqlexpression.php строка 61
65 if (mb_strpos($this->expression,
'\\') ===
false)
68 return preg_replace_callback($this->pattern, array($this,
'execPlaceholders'), $this->expression);
75 foreach ($parts as &$part)
79 $part = preg_replace_callback($this->pattern, array($this,
'execPlaceholders'), $part);
83 $parts = str_replace(
'\\?',
'?', $parts);
85 return implode(
'\\\\', $parts);
◆ execPlaceholders()
execPlaceholders |
( |
|
$matches | ) |
|
|
protected |
Used by compile method to replace placeholders with values.
- Аргументы
-
array | $matches | Matches found by preg_replace. |
- Возвращает
- string
См. определение в файле sqlexpression.php строка 96
105 if (isset($this->args[$this->i]))
109 if ($ph ==
'?' || $ph ==
'?s')
111 $value =
"'" . $sqlHelper->forSql($value) .
"'";
115 $value = $sqlHelper->quote($value);
119 $value = (int) $value;
123 $value = (float) $value;
126 return $pre . $value;
◆ getConnection()
- Возвращает
- Connection
См. определение в файле sqlexpression.php строка 140
142 if ($this->connection ===
null)
static getConnection($name="")
Static method returns database connection for the specified name.
◆ setConnection()
setConnection |
( |
|
$connection | ) |
|
◆ $args
◆ $connection
◆ $expression
◆ $i
◆ $pattern
$pattern = '/([^\\\\]|^)(\?[#sif]?)/' |
|
protected |
Объявления и описания членов класса находятся в файле: