• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/update/block/nodeattributes.php
  • Класс: BitrixLandingUpdateBlockNodeAttributes
  • Вызов: NodeAttributes::collectBlocks
private function collectBlocks()
{
	$this->dataToUpdate = Option::get(self::$moduleId, $this->getOptionName());
	$this->dataToUpdate = ($this->dataToUpdate !== '' ? @unserialize($this->dataToUpdate, ['allowed_classes' => false]) : array());
	$this->codesToStep = array_unique(array_keys($this->dataToUpdate['BLOCKS']));
	$this->codesToStep = array_slice($this->codesToStep, 0, self::STEP_PORTION);

//		load BLOCKS
	$filter = array(
		'CODE' => $this->codesToStep,
		'DELETED' => 'N',
	);
	if (
		isset($this->status['PARAMS'][$this->getOptionName()]['UPDATE_PUBLISHED_SITES']) &&
		$this->status['PARAMS'][$this->getOptionName()]['UPDATE_PUBLISHED_SITES'] != 'Y'
	)
	{
		$filter['PUBLIC'] = 'N';
	}
	
	$resBlock = BlockTable::getList(array(
		'filter' => $filter,
		'select' => array(
			'ID',
			'SORT',
			'CODE',
			'ACTIVE',
			'PUBLIC',
			'DELETED',
			'CONTENT',
			'LID',
			'SITE_ID' => 'LANDING.SITE_ID',
		),
		'order' => array(
			'CODE' => 'ASC',
			'ID' => 'ASC',
		),
	));
	
	while ($row = $resBlock->fetch())
	{
		$this->blocksToUpdate[$row['CODE']][$row['ID']] = new Block($row['ID'], $row);
		if (count($this->blocksToUpdate) > self::STEP_PORTION)
		{
			unset($this->blocksToUpdate[$row['CODE']]);
			break;
		}

//			save sites ID for current blocks to reset cache later
		$this->sitesToUpdate[$row['ID']] = $row['SITE_ID'];
	}
}