• Модуль: search
  • Путь к файлу: ~/bitrix/modules/search/classes/general/search.php
  • Класс: CAllSearch
  • Вызов: CAllSearch::GetIndex
static function GetIndex($MODULE_ID, $ITEM_ID)
{
	$DB = CDatabase::GetModuleConnection('search');
	$rs = $DB->Query("select * from b_search_content where MODULE_ID = '".$DB->ForSql($MODULE_ID)."' and ITEM_ID = '".$DB->ForSql($ITEM_ID)."'");
	$arFields = $rs->Fetch();
	if (!$arFields)
	{
		return false;
	}

	$arFields["SITE_ID"] = array();
	$rs = $DB->Query("select * from b_search_content_site where SEARCH_CONTENT_ID = ".$DB->ForSql($arFields["ID"]));
	while ($ar = $rs->Fetch())
	{
		$arFields["SITE_ID"][$ar["SITE_ID"]] = $ar["URL"];
	}

	$arFields["PERMISSIONS"] = array();
	$rs = $DB->Query("select * from b_search_content_right where SEARCH_CONTENT_ID = ".$DB->ForSql($arFields["ID"]));
	while ($ar = $rs->Fetch())
	{
		$arFields["PERMISSIONS"][] = $ar["GROUP_CODE"];
	}

	$arFields["PARAMS"] = array();
	$rs = $DB->Query("select * from b_search_content_param where SEARCH_CONTENT_ID = ".$DB->ForSql($arFields["ID"]));
	while ($ar = $rs->Fetch())
	{
		$arFields["PARAMS"][$ar["PARAM_NAME"]][] = $ar["PARAM_VALUE"];
	}

	return $arFields;
}