Метод toValidationException
Сигнатура метода
private static function toValidationException(Result $result, int $formId = 0): FormValidationException
Возвращает:
FormValidationException
Описание
Turns an unsuccessful write into the one error format the caller understands. The storage writes what the caller sent and nothing else, so its refusals are refusals of that input and belong to the input paths. Every writer answers with a code this method can read as such a path: the section writers name their column or their section, and the writer of the ad links addresses to the section of the input the refusals of the mechanism owning them, which answers with no code at all. The text of the storage stays inside and goes to the log instead: the ORM and the legacy options write about the columns they refused, and the shape of the schema is not part of the public contract. The path of the input is what the caller acts on anyway. A form id given here is the id of a form that was created before the failure. It travels on the refusal itself rather than inside the errors: which form exists is one fact about the operation, not a property of any field of the input.
Параметры
2| Имя | Тип | По умолчанию | Флаги |
|---|---|---|---|
$result
|
Result
|
—
|
—
|
$formId
|
int
|
0
|
—
|
Расположение
Исходный файл метода в Bitrix Framework
~/bitrix/modulescrm/lib/V2/Internal/Service/WebForm/FormWriter.php