• Модуль: highloadblock
  • Путь к файлу: ~/bitrix/modules/highloadblock/lib/highloadblocktable.php
  • Класс: BitrixHighloadblockHighloadBlockTable
  • Вызов: HighloadBlockTable::validateTableExisting
static function validateTableExisting($value, $primary, array $row, EntityField $field)
{
	$checkName = null;

	if (empty($primary))
	{
		// new row
		$checkName = $value;
	}
	else
	{
		// update row
		$oldData = static::getByPrimary($primary)->fetch();

		if ($value != $oldData['TABLE_NAME'])
		{
			// table name has been changed for existing row
			$checkName = $value;
		}
	}

	if (!empty($checkName))
	{
		if (Application::getConnection()->isTableExists($checkName))
		{
			return GetMessage('HIGHLOADBLOCK_HIGHLOAD_BLOCK_ENTITY_TABLE_NAME_ALREADY_EXISTS',
				array('#TABLE_NAME#' => $value)
			);
		}
	}

	return true;
}