Documentation

GetByID

array
CBlogUser::GetByID(
 int ID,
 int selectType = BLOG_BY_BLOG_USER_ID
);

The method returns parameters for the blog user with the ID. Static method.

Method parameters

ParameterDescription
ID User ID.
selectType Type of selection. Can have the following values:
  • BLOG_BY_BLOG_USER_ID - search user by the blog user ID;
  • BLOG_BY_USER_ID - search user by the site user ID.
Optional. By default equals to BLOG_BY_BLOG_USER_ID.

Returned value

An array with the blog user fields is returned.

Note

This method uses built-in caching. As a result, when the method is used multiple times on the page, the database request will be performed only once

See Also

Examples of use

<?
$ID = $USER->GetID();
$arUser = CBlogUser::GetByID($ID, BLOG_BY_USER_ID);
if(is_array($arUser))
    print_r($arUser);
else
    echo "User not found.";
?>


© «Bitrix24», 2001-2024
Up