1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
elementskuproperty.php
См. документацию.
1<?php
7namespace Bitrix\Iblock\Template\Entity;
8
10{
11 protected $ids = null;
12 protected $iblockId = 0;
13 protected $properties = array();
14
18 protected static function getInstance($id)
19 {
20 $key = implode(',', $id);
21 $class = get_called_class();
22 if (!isset(static::$instance[$class]))
23 {
24 static::$instance[$class] = [];
25 }
26 if (!isset(static::$instance[$class][$key]))
27 {
28 static::$instance[$class][$key] = new static($id);
29 }
30 return static::$instance[$class][$key];
31 }
32
36 public function __construct($ids)
37 {
38 parent::__construct(0);
39 $this->ids = $ids;
40 }
41
49 public function setIblockId($iblockId)
50 {
51 $this->iblockId = intval($iblockId);
52 }
53
60 protected function loadFromDatabase()
61 {
62 if (!isset($this->fields) && $this->iblockId > 0 && is_array($this->ids))
63 {
64 $this->fields = array();
65 foreach($this->ids as $id)
66 {
67 if ($id > 0)
68 {
69 $propertyList = \CIBlockElement::getProperty(
70 $this->iblockId,
71 $id,
72 array("sort" => "asc"),
73 array("EMPTY" => "N")
74 );
75 while ($property = $propertyList->fetch())
76 {
77 if ($property["VALUE_ENUM"] != "")
78 {
79 $value = $property["VALUE_ENUM"];
80 }
81 elseif ($property["PROPERTY_TYPE"] === "E")
82 {
83 $value = new ElementPropertyElement($property["VALUE"]);
84 }
85 elseif ($property["PROPERTY_TYPE"] === "G")
86 {
87 $value = new ElementPropertySection($property["VALUE"]);
88 }
89 else
90 {
91 if($property["USER_TYPE"] <> '')
92 {
93 $value = new ElementPropertyUserField($property["VALUE"], $property);
94 }
95 else
96 {
97 $value = $property["VALUE"];
98 }
99 }
100
101 $this->fields[$property["ID"]][] = $value;
102 $this->fieldMap[$property["ID"]] = $property["ID"];
103 if ($property["CODE"] != "")
104 $this->fieldMap[mb_strtolower($property["CODE"])] = $property["ID"];
105 }
106 }
107 }
108 }
109 return is_array($this->fields);
110 }
111}
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
if(empty($signedUserToken)) $key
Определения quickway.php:257