1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
productdisabler.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Catalog\Store\EnableWizard;
4
5
use Bitrix\Catalog\CatalogIblockTable;
6
use Bitrix\Iblock\ElementTable;
7
use Bitrix\Main\Application;
8
use Bitrix\Main\Type\Collection;
9
10
final
class
ProductDisabler
11
{
12
public
static
function
getIblocksForDisabling
():
array
13
{
14
$catalogIblocksIterator =
CatalogIblockTable::getList
([
15
'select'
=> [
'IBLOCK_ID'
],
16
'filter'
=> [
17
'=PRODUCT_IBLOCK_ID'
=> 0,
18
]
19
]);
20
$iblocks = $catalogIblocksIterator->fetchAll();
21
$iblocks = array_column($iblocks,
'IBLOCK_ID'
);
22
Collection::normalizeArrayValuesByInt($iblocks);
23
24
return
$iblocks;
25
}
26
27
public
static
function
disable
(): void
28
{
29
$iblocks =
self::getIblocksForDisabling
();
30
if
(empty($iblocks))
31
{
32
return
;
33
}
34
35
foreach
($iblocks as
$iblockId
)
36
{
37
\CIBlock::disableClearTagCache();
38
\Bitrix\Iblock\PropertyIndex\Manager::enableDeferredIndexing
();
39
40
Application::getConnection()->query(
"
41
UPDATE "
.
ElementTable::getTableName
() .
"
42
SET ACTIVE = 'N'
43
WHERE IBLOCK_ID = "
. (
int
)
$iblockId
.
"
44
"
);
45
46
\CIBlock::enableClearTagCache();
47
\Bitrix\Iblock\PropertyIndex\Manager::disableDeferredIndexing
();
48
\CIBlock::clearIblockTagCache(
$iblockId
);
49
\Bitrix\Iblock\PropertyIndex\Manager::runDeferredIndexing
(
$iblockId
);
50
}
51
}
52
}
Bitrix\Catalog\Store\EnableWizard\ProductDisabler
Определения
productdisabler.php:11
Bitrix\Catalog\Store\EnableWizard\ProductDisabler\disable
static disable()
Определения
productdisabler.php:27
Bitrix\Catalog\Store\EnableWizard\ProductDisabler\getIblocksForDisabling
static getIblocksForDisabling()
Определения
productdisabler.php:12
Bitrix\Iblock\ElementTable\getTableName
static getTableName()
Определения
elementtable.php:83
Bitrix\Iblock\PropertyIndex\Manager\disableDeferredIndexing
static disableDeferredIndexing()
Определения
manager.php:300
Bitrix\Iblock\PropertyIndex\Manager\runDeferredIndexing
static runDeferredIndexing($iblockId)
Определения
manager.php:321
Bitrix\Iblock\PropertyIndex\Manager\enableDeferredIndexing
static enableDeferredIndexing()
Определения
manager.php:290
Bitrix\Main\ORM\Data\DataManager\getList
static getList(array $parameters=array())
Определения
datamanager.php:431
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$iblockId
$iblockId
Определения
iblock_catalog_edit.php:30
bitrix
modules
catalog
lib
store
enablewizard
productdisabler.php
Создано системой
1.14.0