Documentation

__construct

 public
\Bitrix\Blog\BlogUser::__construct(
 integer $cacheTime
);

Constructor for class BlogUser.

When passing time $cacheTime when creating a class instance, different user selections will be cached and passed from cache upon repeated request. Otherwise, each time executes a database query.

Parameters

ParameterDescriptionVersion
$cacheTimeInteger. Cache time.

Examples

Get full data for all users that posted messages in this blog.

// $blogId - blog identifier
$cacheTime = 86400; //one day
$blogUser = new \Bitrix\Blog\BlogUser($cacheTime);
$blogUser->setBlogId($blogId);	
$postsUsers = $blogUser->getUsers(\Bitrix\Blog\BlogUser::getPostAuthorsIdsByBlogId($blogId));


© «Bitrix24», 2001-2024
Up