• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/classes/general/checklistitem.php
  • Класс: CTaskCheckListItem
  • Вызов: CTaskCheckListItem::checkFields
static function checkFields($fields, $checkForAdd)
{
	/** @noinspection PhpVariableNamingConventionInspection */
	global $APPLICATION;

	$errors = [];

	if ($checkForAdd)
	{
		$checkResult = TaskCheckListFacade::checkFieldsForAdd($fields);
	}
	else
	{
		$checkResult = TaskCheckListFacade::checkFieldsForUpdate($fields);
	}

	if (!$checkResult->isSuccess())
	{
		/** @var BitrixMainError $error */
		foreach ($checkResult->getErrors() as $error)
		{
			$errors[] = [
				'id' => $error->getCode(),
				'text' => $error->getMessage(),
			];
		}

		if (!empty($errors))
		{
			$e = new CAdminException($errors);
			$APPLICATION->ThrowException($e);
		}
	}

	return empty($errors);
}