• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/commentaux/createentity.php
  • Класс: BitrixSocialnetworkCommentAuxCreateEntity
  • Вызов: CreateEntity::getCommentTypeList
public function getCommentTypeList(): array
{
	if ($this->commentTypeListInited === false)
	{
		$moduleEvent = new BitrixMainEvent(
			'socialnetwork',
			'onCommentAuxGetCommentTypeList',
			[]
		);
		$moduleEvent->send();

		foreach ($moduleEvent->getResults() as $moduleEventResult)
		{
			if ($moduleEventResult->getType() === BitrixMainEventResult::SUCCESS)
			{
				$moduleEventParams = $moduleEventResult->getParameters();

				if (
					is_array($moduleEventParams)
					&& !empty($moduleEventParams['typeList'])
					&& is_array($moduleEventParams['typeList'])
				)
				{
					foreach($moduleEventParams['typeList'] as $type)
					{
						$this->addCommentTypeList($type);
					}
				}
			}
		}

		$this->commentTypeListInited = true;
	}

	return $this->commentTypeList;
}