- Модуль: socialnetwork
- Путь к файлу: ~/bitrix/modules/socialnetwork/lib/componenthelper.php
- Класс: BitrixSocialnetworkComponentHelper
- Вызов: ComponentHelper::getAuthorData
static function getAuthorData(array $params = []): array
{
$userId = (int)($params['userId'] ?? 0);
if ($userId > 0)
{
$result = [
'ID' => $userId
];
$res = MainUserTable::getList([
'filter' => [
'ID' => $userId,
],
'select' => [ 'ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN', 'PERSONAL_PHOTO', 'PERSONAL_GENDER' ]
]);
if ($userFields = $res->fetch())
{
$result = $userFields;
}
}
else
{
$result = [];
}
return $result;
}