• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Marketplace/RegistrationValidator.php
  • Класс: BitrixImV2MarketplaceRegistrationValidator
  • Вызов: RegistrationValidator::validateIconName
public function validateIconName(): self
{
	if (!isset($this->placementBind['OPTIONS']['iconName']))
	{
		$this->result['error'] = 'EMPTY_ERROR_ICON_NAME';
		$this->result['error_description'] = 'Field iconName is empty.';

		return $this;
	}

	if (mb_strlen($this->placementBind['OPTIONS']['iconName']) > 50)
	{
		$this->result['error'] = 'INVALID_ERROR_ICON_NAME';
		$this->result['error_description'] = 'Field iconName is invalid.';

		return $this;
	}

	if (!preg_match('/[a-zA-Z -]/', $this->placementBind['OPTIONS']['iconName']))
	{
		$this->result['error'] = 'INVALID_ERROR_ICON_NAME';
		$this->result['error_description'] = 'Field iconName is invalid.';

		return $this;
	}

	return $this;
}