• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/internals/input.php
  • Класс: BitrixSaleInternalsInputEitherYN
  • Вызов: EitherYN::getErrorSingle
static function getErrorSingle(array $input, $value)
{
	$input['REQUIRED'] ??= 'N';
	if (
		$input['REQUIRED'] === 'Y'
		&& ($value === '' || $value === null)
	)
	{
		return [
			'REQUIRED' => Loc::getMessage('INPUT_REQUIRED_ERROR'),
		];
	}

	return
		($value === 'N' || $value === 'Y')
			? []
			: ['INVALID' => Loc::getMessage('INPUT_INVALID_ERROR')]
	;
}