• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/template/entity/sectionpath.php
  • Класс: BitrixIblockTemplateEntitySectionPath
  • Вызов: SectionPath::loadFromDatabase
public function loadFromDatabase()
{
	if (!isset($this->fields))
	{
		//From down to up
		$select = array_values($this->fieldMap);
		$this->dbPath = array();
		$id = $this->id;
		while ($id > 0)
		{
			$sectionList = BitrixIblockSectionTable::getList(array(
				"select" => $select,
				"filter" => array("=ID" => $id),
			));
			$section = $sectionList->fetch();
			if ($section)
				$this->dbPath[] = $section;
			else
				break;
			$id = $section["IBLOCK_SECTION_ID"];
		}
		//Reversed from up to down
		//and laid by fields
		$this->fields = array();
		for($i = count($this->dbPath)-1; $i >= 0; $i--)
		{
			foreach($this->dbPath[$i] as $fieldName => $fieldValue)
			{
				$this->fields[$fieldName][] = $fieldValue;
			}
		}
		$this->loadProperty();
	}
	return is_array($this->fields);
}