1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
sectionpath.php
См. документацию.
1<?php
7namespace Bitrix\Iblock\Template\Entity;
8
9class SectionPath extends Base
10{
11 protected $dbPath = null;
12
16 public function __construct($id)
17 {
18 parent::__construct($id);
19 $this->fieldMap = array(
20 "name" => "NAME",
21 "previewtext" => "DESCRIPTION",
22 "detailtext" => "DESCRIPTION",
23 "code" => "CODE",
24 //not accessible from template engine
25 "ID" => "ID",
26 "IBLOCK_ID" => "IBLOCK_ID",
27 "IBLOCK_SECTION_ID" => "IBLOCK_SECTION_ID",
28 );
29 }
30
37 public function loadFromDatabase()
38 {
39 if (!isset($this->fields))
40 {
41 //From down to up
42 $select = array_values($this->fieldMap);
43 $this->dbPath = array();
44 $id = $this->id;
45 while ($id > 0)
46 {
48 "select" => $select,
49 "filter" => array("=ID" => $id),
50 ));
51 $section = $sectionList->fetch();
52 if ($section)
53 $this->dbPath[] = $section;
54 else
55 break;
56 $id = $section["IBLOCK_SECTION_ID"];
57 }
58 //Reversed from up to down
59 //and laid by fields
60 $this->fields = array();
61 for($i = count($this->dbPath)-1; $i >= 0; $i--)
62 {
63 foreach($this->dbPath[$i] as $fieldName => $fieldValue)
64 {
65 $this->fields[$fieldName][] = $fieldValue;
66 }
67 }
68 $this->loadProperty();
69 }
70 return is_array($this->fields);
71 }
72
78 protected function loadProperty()
79 {
82
83 foreach ($this->fields["ID"] as $i => $sectionId)
84 {
85 $userFields = $USER_FIELD_MANAGER->getUserFields(
86 "IBLOCK_".$this->fields["IBLOCK_ID"][$i]."_SECTION",
87 $sectionId
88 );
89 foreach ($userFields as $id => $uf)
90 {
91 //TODO $uf["USER_TYPE"]["BASE_TYPE"] == "enum"
92 $propertyCode = $id;
93 $fieldCode = "property.".mb_strtolower(mb_substr($id, 3));
94 $this->fieldMap[$fieldCode] = $propertyCode;
95 if (is_array($uf["VALUE"]))
96 {
97 foreach ($uf["VALUE"] as $value)
98 $this->fields[$propertyCode][] = $value;
99 }
100 else
101 {
102 $this->fields[$propertyCode][] = $uf["VALUE"];
103 }
104 }
105 }
106 }
107}
static getList(array $parameters=array())
Определения datamanager.php:431
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
global $USER_FIELD_MANAGER
Определения attempt.php:6
$select
Определения iblock_catalog_list.php:194
$i
Определения factura.php:643
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936