1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
iblockvalues.php
См. документацию.
1<?php
7namespace Bitrix\Iblock\InheritedProperty;
8
10{
14 public function __construct($iblockId)
15 {
16 parent::__construct($iblockId);
17 }
18
24 public function getValueTableName()
25 {
26 return "b_iblock_iblock_iprop";
27 }
28
34 public function getType()
35 {
36 return "B";
37 }
38
44 public function getId()
45 {
46 return $this->iblockId;
47 }
48
54 public function createTemplateEntity()
55 {
56 return new \Bitrix\Iblock\Template\Entity\Iblock($this->iblockId);
57 }
58
64 public function getParents()
65 {
66 return array();
67 }
68
75 public function queryValues()
76 {
77 $result = array();
78 if ($this->hasTemplates())
79 {
81 $query = $connection->query("
82 SELECT
83 P.ID
84 ,P.CODE
85 ,P.TEMPLATE
86 ,P.ENTITY_TYPE
87 ,P.ENTITY_ID
88 ,IP.VALUE
89 FROM
90 b_iblock_iblock_iprop IP
91 INNER JOIN b_iblock_iproperty P ON P.ID = IP.IPROP_ID
92 WHERE
93 IP.IBLOCK_ID = ".$this->iblockId."
94 ");
95
96 while ($row = $query->fetch())
97 {
98 $result[$row["CODE"]] = $row;
99 }
100
101 if (empty($result))
102 {
103 $result = parent::queryValues();
104 $fields = array(
105 "IBLOCK_ID",
106 "IPROP_ID",
107 );
108 $rows = array();
109 foreach ($result as $row)
110 {
111 $rows[] = array(
112 'IBLOCK_ID' => $this->iblockId,
113 'IPROP_ID' => $row["ID"],
114 'VALUE' => $row["VALUE"],
115 );
116 }
117 $this->insertValues("b_iblock_iblock_iprop", $fields, $rows);
118 }
119 }
120 return $result;
121 }
122
128 function clearValues()
129 {
131 $connection->query("
132 DELETE FROM b_iblock_element_iprop
133 WHERE IBLOCK_ID = ".$this->iblockId."
134 ");
135 $connection->query("
136 DELETE FROM b_iblock_section_iprop
137 WHERE IBLOCK_ID = ".$this->iblockId."
138 ");
139 $connection->query("
140 DELETE FROM b_iblock_iblock_iprop
141 WHERE IBLOCK_ID = ".$this->iblockId."
142 ");
143 }
144}
$connection
Определения actionsdefinitions.php:38
insertValues($tableName, $primaryFields, $rows)
Определения basevalues.php:207
static getConnection($name="")
Определения application.php:638
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$query
Определения get_search.php:11
$rows
Определения options.php:264
$fields
Определения yandex_run.php:501