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

	// check title
	if (
		$primary['ID'] &&
		(
			isset($fields['TITLE']) &&
			!trim($fields['TITLE'])
		)
	)
	{
		$row = self::getList([
			'filter' => [
				'ID' => $primary['ID']
			]
		])->fetch();
		if (
			$row &&
			!trim($row['XML_ID'])
		)
		{
			$result->setErrors(array(
				new EntityEntityError(
					Loc::getMessage('LANDING_TABLE_ERROR_TITLE_REQUIRED'),
					'TITLE_REQUIRED'
				)
			));
		}
		unset($primary, $fields, $row);

		return $result;
	}

	unset($primary, $fields);

	return $result;
}