Метод buildCrmPrefixCondition
Расположение
Исходный файл метода в Bitrix Framework
~/bitrix/modulestasks/lib/provider/query/taskfilterbuilder.php
Исходный код
Сигнатура метода
private function buildCrmPrefixCondition(string $prefix): string
Возвращает:
string
Описание
Builds a sargable prefix condition on the VALUE slug column: VALUE LIKE 'prefix%' so the (FIELD_ID, VALUE(50)) index range-scans instead of scanning the whole field. The literal prefix (a CRM type abbreviation like D_, C_, T) has \ % _ ' escaped in one pass: the LIKE metacharacters are prefixed with a backslash so they match literally, the quote is escaped for the literal. This relies on LIKE's default escape character (backslash), which is identical on MySQL and PostgreSQL; no explicit ESCAPE clause is emitted on purpose, since ESCAPE '\\' breaks on PostgreSQL with standard_conforming_strings=on (the literal '\\' is two characters there, while ESCAPE requires exactly one). prepareForSprintf() then doubles every % because whereExpr() feeds the expression through sprintf() (the trailing wildcard % survives as %%).
Параметры
1| Имя | Тип | По умолчанию | Флаги |
|---|---|---|---|
$prefix
|
string
|
-
|
-
|