• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/db/sqlhelper.php
  • Класс: BitrixMainDBSqlHelper
  • Вызов: SqlHelper::getConditionalAssignment
public function getConditionalAssignment(string $field, string $value): string
{
	$field = $this->quote($field);
	$hash = $this->convertToDbString(sha1($value));
	$value = $this->convertToDbString($value);

	return 'case when ' . $this->getSha1Function($field) . ' = ' . $hash . ' then ' . $field . ' else ' . $value . ' end';
}