1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
basevalues.php
См. документацию.
1
<?php
7
namespace
Bitrix\Iblock\InheritedProperty;
8
9
abstract
class
BaseValues
10
{
12
protected
$iblockId
=
null
;
13
15
protected
$values
=
false
;
16
18
protected
$queue
=
null
;
19
23
public
function
__construct
(
$iblockId
)
24
{
25
$this->iblockId = (int)
$iblockId
;
26
$this->
queue
=
ValuesQueue::getInstance
(get_called_class());
27
}
28
34
public
function
getIblockId
()
35
{
36
return
$this->iblockId
;
37
}
38
44
public
function
getValueTableName
()
45
{
46
return
""
;
47
}
48
54
abstract
public
function
getType
();
55
61
abstract
public
function
getId
();
62
68
abstract
public
function
createTemplateEntity
();
69
75
public
function
getParents
()
76
{
77
return
array
();
78
}
79
86
public
function
getParent
()
87
{
88
$parents = $this->
getParents
();
89
if
(isset($parents[0]))
90
return
$parents[0];
91
else
92
return
null
;
93
}
94
101
public
function
getValues
()
102
{
103
if
($this->values ===
false
)
104
$this->values = $this->
queryValues
();
105
106
$result
=
array
();
107
foreach
($this->values as $CODE => $row)
108
{
109
$result
[$CODE] =
\Bitrix\Main\Text\HtmlFilter::encode
(
110
$row[
'VALUE'
],
111
ENT_COMPAT,
112
false
113
);
114
}
115
return
$result
;
116
}
117
125
public
function
getValue
($propertyCode)
126
{
127
if
($this->values ===
false
)
128
$this->values = $this->
queryValues
();
129
130
if
(isset($this->values[$propertyCode]))
131
return
htmlspecialcharsEx
($this->values[$propertyCode][
"VALUE"
]);
132
else
133
return
""
;
134
}
135
143
public
function
queryValues
()
144
{
145
$templateInstance =
new
BaseTemplate
($this);
146
$templates = $templateInstance->findTemplates();
147
foreach
($templates as $CODE => $row)
148
{
149
$templates[$CODE][
"VALUE"
] =
\Bitrix\Iblock\Template\Engine::process
($this->
createTemplateEntity
(), $row[
"TEMPLATE"
]);
150
}
151
return
$templates;
152
}
153
159
public
function
hasTemplates
()
160
{
161
$templateInstance =
new
BaseTemplate
($this);
162
return
$templateInstance->hasTemplates($this);
163
}
164
170
abstract
function
clearValues
();
171
179
public
function
deleteValues
($ipropertyId)
180
{
181
$ipropertyId = (int)$ipropertyId;
182
$connection
=
\Bitrix\Main\Application::getConnection
();
183
$connection
->query(
"
184
DELETE FROM b_iblock_iblock_iprop
185
WHERE IPROP_ID = "
.$ipropertyId.
"
186
"
);
187
$connection
->query(
"
188
DELETE FROM b_iblock_section_iprop
189
WHERE IPROP_ID = "
.$ipropertyId.
"
190
"
);
191
$connection
->query(
"
192
DELETE FROM b_iblock_element_iprop
193
WHERE IPROP_ID = "
.$ipropertyId.
"
194
"
);
195
ValuesQueue::deleteAll
();
196
}
197
207
protected
function
insertValues
($tableName, $primaryFields,
$rows
)
208
{
209
$connection
=
\Bitrix\Main\Application::getConnection
();
210
$sqlHelper =
$connection
->getSqlHelper();
211
foreach
($sqlHelper->prepareMergeMultiple($tableName, $primaryFields,
$rows
) as $dml)
212
{
213
$connection
->query($dml);
214
}
215
}
216
225
public
static
function
queue
(
$iblockId
, $id)
226
{
227
ValuesQueue::getInstance
(get_called_class())->addElement(
$iblockId
, $id);
228
}
229
}
$connection
$connection
Определения
actionsdefinitions.php:38
Bitrix\Iblock\InheritedProperty\BaseTemplate
Определения
basetemplate.php:10
Bitrix\Iblock\InheritedProperty\BaseValues
Определения
basevalues.php:10
Bitrix\Iblock\InheritedProperty\BaseValues\__construct
__construct($iblockId)
Определения
basevalues.php:23
Bitrix\Iblock\InheritedProperty\BaseValues\getId
getId()
Bitrix\Iblock\InheritedProperty\BaseValues\$iblockId
$iblockId
Определения
basevalues.php:12
Bitrix\Iblock\InheritedProperty\BaseValues\getValueTableName
getValueTableName()
Определения
basevalues.php:44
Bitrix\Iblock\InheritedProperty\BaseValues\getIblockId
getIblockId()
Определения
basevalues.php:34
Bitrix\Iblock\InheritedProperty\BaseValues\getParents
getParents()
Определения
basevalues.php:75
Bitrix\Iblock\InheritedProperty\BaseValues\$queue
$queue
Определения
basevalues.php:18
Bitrix\Iblock\InheritedProperty\BaseValues\clearValues
clearValues()
Bitrix\Iblock\InheritedProperty\BaseValues\hasTemplates
hasTemplates()
Определения
basevalues.php:159
Bitrix\Iblock\InheritedProperty\BaseValues\getValues
getValues()
Определения
basevalues.php:101
Bitrix\Iblock\InheritedProperty\BaseValues\insertValues
insertValues($tableName, $primaryFields, $rows)
Определения
basevalues.php:207
Bitrix\Iblock\InheritedProperty\BaseValues\getType
getType()
Bitrix\Iblock\InheritedProperty\BaseValues\deleteValues
deleteValues($ipropertyId)
Определения
basevalues.php:179
Bitrix\Iblock\InheritedProperty\BaseValues\getParent
getParent()
Определения
basevalues.php:86
Bitrix\Iblock\InheritedProperty\BaseValues\getValue
getValue($propertyCode)
Определения
basevalues.php:125
Bitrix\Iblock\InheritedProperty\BaseValues\createTemplateEntity
createTemplateEntity()
Bitrix\Iblock\InheritedProperty\BaseValues\queue
static queue($iblockId, $id)
Определения
basevalues.php:225
Bitrix\Iblock\InheritedProperty\BaseValues\queryValues
queryValues()
Определения
basevalues.php:143
Bitrix\Iblock\InheritedProperty\BaseValues\$values
$values
Определения
basevalues.php:15
Bitrix\Iblock\InheritedProperty\ValuesQueue\getInstance
static getInstance($key)
Определения
valuesqueue.php:25
Bitrix\Iblock\InheritedProperty\ValuesQueue\deleteAll
static deleteAll()
Определения
valuesqueue.php:37
Bitrix\Iblock\Template\Engine\process
static process(Entity\Base $entity, $template)
Определения
engine.php:80
Bitrix\Main\Application\getConnection
static getConnection($name="")
Определения
application.php:638
Bitrix\Main\Text\HtmlFilter\encode
static encode($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения
htmlfilter.php:12
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
htmlspecialcharsEx
htmlspecialcharsEx($str)
Определения
tools.php:2685
$rows
$rows
Определения
options.php:264
bitrix
modules
iblock
lib
inheritedproperty
basevalues.php
Создано системой
1.14.0