Bitrix API

BlogUser

Table of Contents

Constants

CACHE_ID  = 'BLOG_USERS'

Methods

__construct()  : mixed
Blog users can be saved in cache or get from DB. To cached - set cacheTime
addAvatarSize()  : mixed
cleanCache()  : mixed
Delete all data from blog users cache
getCommentAuthorsIdsByPostId()  : mixed
Return users ids of post author and comments authors (for this post)
getPostAuthorsIdsByBlogId()  : mixed
Return users ids of blog posts
getPostAuthorsIdsByDbFilter()  : array<string|int, mixed>
Return IDs of post authors by custom selection
GetUserName()  : string
Creat correctly blog user name from name, alias and login
GetUserNameEx()  : mixed
getUsers()  : array<string|int, mixed>|bool
Get users from cache (if set cache time) or from DB.
isUserGivenConsent()  : mixed
Check, is user given consent for current agreement ever in the past.
onUserDelete()  : bool
Handles onUserDelete main module event
setBlogId()  : mixed
Blog ID using to separate cache for different blogs
setCacheTime()  : mixed

Constants

CACHE_ID

public mixed CACHE_ID = 'BLOG_USERS'

Methods

__construct()

Blog users can be saved in cache or get from DB. To cached - set cacheTime

public __construct([int $cacheTime = 0 ]) : mixed

BlogUser constructor.

Parameters
$cacheTime : int = 0
  • integer - value of cache TTL

addAvatarSize()

public addAvatarSize(mixed $width, mixed $height[, mixed $key = "" ]) : mixed
Parameters
$width : mixed
$height : mixed
$key : mixed = ""

cleanCache()

Delete all data from blog users cache

public static cleanCache([mixed $blogId = null ]) : mixed
Parameters
$blogId : mixed = null

getCommentAuthorsIdsByPostId()

Return users ids of post author and comments authors (for this post)

public static getCommentAuthorsIdsByPostId(mixed $postId) : mixed
Parameters
$postId : mixed

getPostAuthorsIdsByBlogId()

Return users ids of blog posts

public static getPostAuthorsIdsByBlogId(mixed $blogId) : mixed
Parameters
$blogId : mixed

getPostAuthorsIdsByDbFilter()

Return IDs of post authors by custom selection

public static getPostAuthorsIdsByDbFilter(mixed $arFilter) : array<string|int, mixed>
Parameters
$arFilter : mixed
Tags
throws
ArgumentNullException
Return values
array<string|int, mixed>

GetUserName()

Creat correctly blog user name from name, alias and login

public static GetUserName(mixed $alias, mixed $name, mixed $lastName, mixed $login[, string $secondName = "" ]) : string
Parameters
$alias : mixed
$name : mixed
$lastName : mixed
$login : mixed
$secondName : string = ""
Return values
string

GetUserNameEx()

public static GetUserNameEx(mixed $user, mixed $blogUser, mixed $params) : mixed
Parameters
$user : mixed
$blogUser : mixed
$params : mixed

getUsers()

Get users from cache (if set cache time) or from DB.

public getUsers([array<string|int, mixed> $ids = array() ]) : array<string|int, mixed>|bool
Parameters
$ids : array<string|int, mixed> = array()
  • array of users ids
Return values
array<string|int, mixed>|bool

isUserGivenConsent()

Check, is user given consent for current agreement ever in the past.

public static isUserGivenConsent(mixed $userId, mixed $agreementId) : mixed

Consent checked based on component URL, it means, that if URL will be changed, result will be false again.

Parameters
$userId : mixed
  • ID of main user (not blog user!)
$agreementId : mixed

onUserDelete()

Handles onUserDelete main module event

public static onUserDelete([mixed $userId = null ]) : bool
Parameters
$userId : mixed = null
Return values
bool

setBlogId()

Blog ID using to separate cache for different blogs

public setBlogId(mixed $id) : mixed
Parameters
$id : mixed

setCacheTime()

public setCacheTime(mixed $cacheTime) : mixed
Parameters
$cacheTime : mixed

        
On this page

Search results