1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
productdisabler.php
См. документацию.
1<?php
2
3namespace Bitrix\Catalog\Store\EnableWizard;
4
5use Bitrix\Catalog\CatalogIblockTable;
6use Bitrix\Iblock\ElementTable;
7use Bitrix\Main\Application;
8use Bitrix\Main\Type\Collection;
9
10final 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 {
30 if (empty($iblocks))
31 {
32 return;
33 }
34
35 foreach ($iblocks as $iblockId)
36 {
37 \CIBlock::disableClearTagCache();
39
40 Application::getConnection()->query("
41 UPDATE " . ElementTable::getTableName() . "
42 SET ACTIVE = 'N'
43 WHERE IBLOCK_ID = " . (int)$iblockId . "
44 ");
45
46 \CIBlock::enableClearTagCache();
48 \CIBlock::clearIblockTagCache($iblockId);
50 }
51 }
52}
static getTableName()
Определения elementtable.php:83
static disableDeferredIndexing()
Определения manager.php:300
static runDeferredIndexing($iblockId)
Определения manager.php:321
static enableDeferredIndexing()
Определения manager.php:290
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
$iblockId
Определения iblock_catalog_edit.php:30