- Модуль: socialnetwork
- Путь к файлу: ~/bitrix/modules/socialnetwork/lib/controller/livefeed.php
- Класс: BitrixSocialnetworkControllerLivefeed
- Вызов: Livefeed::createTaskCommentAction
public function createTaskCommentAction(array $params = []): void
{
$postEntityType = (isset($params['postEntityType']) && $params['postEntityType'] <> '' ? preg_replace('/[^a-z0-9_]/i', '', $params['postEntityType']) : false);
$sourceEntityType = (isset($params['entityType']) && $params['entityType'] <> '' ? preg_replace("/[^a-z0-9_]/i", '', $params['entityType']) : false);
$sourceEntityId = (isset($params['entityId']) && (int)$params['entityId'] > 0 ? (int)$params['entityId'] : false);
$taskId = (isset($params['taskId']) && (int)$params['taskId'] > 0 ? (int)$params['taskId'] : false);
$logId = (isset($params['logId']) && (int)$params['logId'] > 0 ? (int)$params['logId'] : false);
if (
!$sourceEntityType
|| !$sourceEntityId
|| !$taskId
)
{
return;
}
$this->createEntityCommentAction([
'postEntityType' => $postEntityType,
'sourceEntityType' => $sourceEntityType,
'sourceEntityId' => $sourceEntityId,
'entityType' => CommentAuxCreateEntity::ENTITY_TYPE_TASK,
'entityId' => $taskId,
'logId' => $logId,
]);
}