- Модуль: translate
- Путь к файлу: ~/bitrix/modules/translate/lib/index/pathindexcollection.php
- Класс: BitrixTranslateIndexPathIndexCollection
- Вызов: PathIndexCollection::collect
public function collect(TranslateFilter $filter = null, TranslateControllerITimeLimit $timer = null, TranslateFilter $seek = null): int
{
self::configure();
if (isset($filter, $filter->path))
{
$relPath = $filter->path;
}
else
{
$relPath = TranslateConfig::getDefaultPath();
}
$relPath = '/'. trim($relPath, '/');
if (self::$useTranslationRepository)
{
$this->checkLanguages = self::$translationEnabledLanguages;
if (isset($filter, $filter->langId))
{
$this->checkLanguages = array_intersect($filter->langId, $this->checkLanguages);
}
}
$pathFilter = [
'=%PATH' => $relPath.'%'
];
if (isset($seek, $seek->pathLangId))
{
$pathFilter['>ID'] = $seek->pathLangId;
}
$cachePathLangRes = IndexInternalsPathLangTable::getList([
'filter' => $pathFilter,
'order' => ['ID' => 'ASC'],
'select' => ['ID', 'PATH'],
]);
$processedItemCount = 0;
while ($pathLang = $cachePathLangRes->fetch())
{
$this->collectFilePath($pathLang['PATH']);
$processedItemCount ++;
if ($timer !== null && $timer->hasTimeLimitReached())
{
if ($seek !== null)
{
$seek->nextLangPathId = (int)$pathLang['ID'];
}
break;
}
}
return $processedItemCount;
}