• Модуль: translate
  • Путь к файлу: ~/bitrix/modules/translate/lib/controller/index/collectpathindex.php
  • Класс: BitrixTranslateControllerIndexCollectPathIndex
  • Вызов: CollectPathIndex::runIndexing
private function runIndexing(array $params): array
{
	$path = rtrim($params['path'], '/');

	$seek = new TranslateFilter();
	if (!empty($this->seekPathLangId))
	{
		$seek->pathLangId = $this->seekPathLangId;
	}

	$indexer = new IndexPathIndexCollection();

	$filter = new TranslateFilter(['path' => $path]);

	if ($this->processedItems >= $this->totalItems)
	{
		$indexer->validate($filter, false);
	}
	else
	{
		if (!empty($this->languages))
		{
			$filter->langId = $this->languages;
		}

		$processedItemCount = $indexer->collect($filter, $this->instanceTimer(), $seek);

		$this->processedItems += $processedItemCount;
	}

	if ($this->processedItems >= $this->totalItems && $this->instanceTimer()->hasTimeLimitReached() !== true)
	{
		$this->declareAccomplishment();
		$this->clearProgressParameters();
	}
	else
	{
		$this->seekPathLangId = $seek->nextLangPathId;
	}

	return [
		'PROCESSED_ITEMS' => $this->processedItems,
		'TOTAL_ITEMS' => $this->totalItems,
	];
}