• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/component/loglist/processor.php
  • Класс: BitrixSocialnetworkComponentLogListProcessor
  • Вызов: Processor::processOrderData
public function processOrderData(): void
{
	$params = $this->getComponent()->arParams;

	if (
		!empty($params['ORDER'])
		&& is_array($params['ORDER'])
	)
	{
		$this->setOrder($params['ORDER']);
	}
	elseif ($this->getComponent()->getCommentsNeededValue())
	{
		$this->setOrder(
			!empty($this->getFilterContent())
				? []
				: [ 'LOG_UPDATE' => 'DESC' ]
		);
	}
	elseif ($params['USE_FOLLOW'] === 'Y')
	{
		$this->setOrder([ 'DATE_FOLLOW' => 'DESC' ]);
	}
	elseif ($params['USE_COMMENTS'] === 'Y')
	{
		$this->setOrder(
			!empty($this->getFilterContent())
				? [ 'CONTENT_LOG_UPDATE' => 'DESC' ]
				: [ 'LOG_UPDATE' => 'DESC' ]
		);
//			$this->setOrder(!empty($this->->getProcessorInstance()->getFilterContent()) ? [] : [ 'LOG_UPDATE' => 'DESC' ]);
	}

	$this->setOrderKey('ID', 'DESC');
	$order = $this->getOrder();
	$res = getModuleEvents('socialnetwork', 'OnBuildSocNetLogOrder');
	while ($eventFields = $res->fetch())
	{
		executeModuleEventEx($eventFields, [ &$order, $params ]);
	}
	$this->setOrder($order);
}