• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/internals/role.php
  • Класс: BitrixLandingInternalsRoleTable
  • Вызов: RoleTable::OnBeforeAdd
static function OnBeforeAdd(EntityEvent $event)
{
	$result = new EntityEventResult();
	$fields = $event->getParameter('fields');

	// check title
	if (
		(
			!isset($fields['TITLE']) ||
			!trim($fields['TITLE'])
		) &&
		(
			!isset($fields['XML_ID']) ||
			!trim($fields['XML_ID'])
		)
	)
	{
		$result->setErrors(array(
			new EntityEntityError(
				Loc::getMessage('LANDING_TABLE_ERROR_TITLE_REQUIRED'),
				'TITLE_REQUIRED'
			)
		));
	}

	$result->modifyFields([
		'TYPE' => BitrixLandingSiteType::getFilterType(true)
  	]);

	return $result;
}