Метод validate

public

Сигнатура метода

public function validate(Activity $activity, ProviderPayload $payload, ValidationContext $context): Result

Возвращает: Result

Описание

Checks and normalizes the fields of an activity of this kind before they are stored. NORMALIZATION HAPPENS BY MUTATION - the provider changes the activity, the payload and the columns carried by the context, and those changes are what gets written. This is the typed replacement of the by-reference field array of legacy, and the deadline is the reason it cannot be read-only: a deadline is not a field of the caller but a value derived by the provider from the start or the end of an activity, and there is no other point in an operation where it may be derived. A FAILING RESULT REFUSES THE WHOLE OPERATION, as an error of the check did in legacy. The errors are the ones shown to whoever asked, so they are messages about the fields and not about the provider.

Параметры

3
Имя Тип По умолчанию Флаги
$activity Activity —
—
$payload ProviderPayload —
—
$context ValidationContext —
—

Расположение

Исходный файл метода в Bitrix Framework

Путь к исходному файлу Source
~/bitrix/modulescrm/lib/V2/Internal/Service/Activity/Provider/ActivityProviderInterface.php
Расположение метода в файле
Строки 89–89

Исходный код

PHP