• Модуль: translate
  • Путь к файлу: ~/bitrix/modules/translate/lib/index/fileindexcollection.php
  • Класс: BitrixTranslateIndexFileIndexCollection
  • Вызов: FileIndexCollection::countItemsToProcess
public function countItemsToProcess(TranslateFilter $filter = null): int
{
	if (isset($filter, $filter->path))
	{
		$relPath = '/'. trim($filter->path, '/');
		$relPath = TranslateIOPath::replaceLangId($relPath, '#LANG_ID#');

		$topPathRes = IndexInternalsPathIndexTable::getList([
			'select' => ['ID'],
			'filter' => ['=PATH' => $relPath]
		]);
		if (!($topPath = $topPathRes->fetch()))
		{
			return 0;
		}

		$pathFilter = [
			'=IS_DIR' => 'N',
			'=IS_LANG' => 'Y',
			'=%PATH' => $relPath.'%#LANG_ID#%',
			'=DESCENDANTS.PARENT_ID' => $topPath['ID'],//ancestor
			//todo: add filter by INDEXED_TIME
		];
		$totalItems = (int)IndexInternalsPathIndexTable::getCount($pathFilter);
	}
	else
	{
		$totalItems = (int)IndexInternalsPathIndexTable::getCount();
	}

	return $totalItems;
}