• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/volume/module/crm.php
  • Класс: BitrixDiskVolumeModuleCrm
  • Вызов: Crm::getFolderList
public function getFolderList($storage): array
{
	if (
		$storage instanceof DiskStorage
		&& $storage->getId() > 0
	)
	{
		if (
			!isset($this->folderList[$storage->getId()])
			|| empty($this->folderList[$storage->getId()])
		)
		{
			$this->folderList[$storage->getId()] = [];
			if ($this->isMeasureAvailable())
			{
				$typeFolderXmlId = self::getSpecialFolderXmlId();
				if (count($typeFolderXmlId) > 0)
				{
					foreach ($typeFolderXmlId as $xmlId)
					{
						$folder = DiskFolder::load([
							'=XML_ID' => $xmlId,
							'=STORAGE_ID' => $storage->getId(),
						]);
						if (!$folder instanceof DiskFolder)
						{
							continue;
						}
						if ($folder->getXmlId() !== $xmlId)
						{
							continue;
						}
						$this->folderList[$storage->getId()][$xmlId] = $folder;
					}
				}
			}
		}

		return $this->folderList[$storage->getId()];
	}

	return [];
}