Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Класс CounterService
+ Граф наследования:CounterService:

Открытые члены

 __construct (?int $userId=null)
 
 getTotal ()
 
 getByChatForEachUsers (int $chatId, ?array $userIds=null)
 
 getByChat (int $chatId)
 
 get ()
 
 getForEachChat (?array $chatIds=null)
 
 getForNotifyChat ()
 
 getForNotifyChats (array $chatIds)
 
 getIdFirstUnreadMessage (int $chatId)
 
 getIdFirstUnreadMessageForEachChats (array $chatIds)
 
 updateIsMuted (int $chatId, string $isMuted)
 
 deleteByChatId (int $chatId)
 
 deleteAll (bool $withNotify=false)
 
 addForEachUser (Message $message, RelationCollection $relations)
 
 addCollection (MessageCollection $messages, Relation $relation)
 
 addStartingFrom (int $messageId, Relation $relation)
 
 deleteByMessageIdForAll (int $messageId, ?array $invalidateCacheUsers=null)
 
 deleteByMessageIdsForAll (array $messageIds, ?array $invalidateCacheUsers=null)
 
 deleteTo (Message $message)
 

Открытые статические члены

static onAfterUserUpdate (array $fields)
 
static deleteCountersOfFiredUserAgent (int $userId)
 
static deleteExpiredCountersAgent ()
 
static clearCache (?int $userId=null)
 

Защищенные члены

 getCacheForPreparedCounters ()
 
 getCacheForChatsCounters ()
 
 savePreparedCountersInCache (Cache $cache)
 
 saveChatsCountersInCache (Cache $cache)
 
 saveSpecificChatsCountersInCache (array $chatIds)
 
 countUnreadChats ()
 
 countUnreadMessages (?array $chatIds=null)
 
 setUnreadChat (int $id, bool $isMuted)
 
 setFromMutedChat (int $id, int $count)
 
 setFromNotify (int $count)
 
 setFromLine (int $id, int $count)
 
 setFromCopilot (int $id, int $count)
 
 setFromChat (int $id, int $count)
 
 getUnreadChats (?bool $isMuted=null)
 
 getCountersForEachChat (?array $chatIds=null, bool $forCurrentUser=true)
 
 getAdditionalCounters (?array $chatIds=null, bool $forCurrentUser=true)
 
 getTotalCountUnreadMessages ()
 
 getCountUnreadMessagesByChatIdForEachUsers (int $chatId, ?array $userIds=null)
 
 getCountUnreadMessagesByChatId (int $chatId)
 
 haveInSpecificChatsCache (array $chatIds)
 

Защищенные статические члены

static onFireUser (int $userId)
 
static onHireUser (int $userId)
 

Защищенные данные

const DELAY_DELETION_COUNTERS_OF_FIRED_USER = 604800
 
const EXPIRY_INTERVAL = '-12 months'
 
const CACHE_TTL = 86400
 
const CACHE_NAME = 'counter_v5'
 
const CACHE_CHATS_COUNTERS_NAME = 'chats_counter_v6'
 
const CACHE_PATH = '/bx/im/v2/counter/'
 
const DEFAULT_COUNTERS
 
array $counters
 
array $countersByChatIds = []
 

Статические защищенные данные

static array $staticCounterCache = []
 
static array $staticChatsCounterCache = []
 
static array $staticSpecificChatsCounterCache = []
 

Подробное описание

См. определение в файле CounterService.php строка 25

Конструктор(ы)

◆ __construct()

__construct ( ?int $userId = null)

См. определение в файле CounterService.php строка 59

Методы

◆ addCollection()

addCollection ( MessageCollection $messages,
Relation $relation )

См. определение в файле CounterService.php строка 312

◆ addForEachUser()

addForEachUser ( Message $message,
RelationCollection $relations )

См. определение в файле CounterService.php строка 289

◆ addStartingFrom()

addStartingFrom ( int $messageId,
Relation $relation )

См. определение в файле CounterService.php строка 330

◆ clearCache()

static clearCache ( ?int $userId = null)
static

См. определение в файле CounterService.php строка 462

◆ countUnreadChats()

countUnreadChats ( )
protected

Переопределяется в CounterServiceLegacy.

См. определение в файле CounterService.php строка 524

◆ countUnreadMessages()

countUnreadMessages ( ?array $chatIds = null)
protected

Переопределяется в CounterServiceLegacy.

См. определение в файле CounterService.php строка 534

◆ deleteAll()

deleteAll ( bool $withNotify = false)

См. определение в файле CounterService.php строка 276

◆ deleteByChatId()

deleteByChatId ( int $chatId)

См. определение в файле CounterService.php строка 264

◆ deleteByMessageIdForAll()

deleteByMessageIdForAll ( int $messageId,
?array $invalidateCacheUsers = null )

См. определение в файле CounterService.php строка 355

◆ deleteByMessageIdsForAll()

deleteByMessageIdsForAll ( array $messageIds,
?array $invalidateCacheUsers = null )

См. определение в файле CounterService.php строка 377

◆ deleteCountersOfFiredUserAgent()

static deleteCountersOfFiredUserAgent ( int $userId)
static

См. определение в файле CounterService.php строка 418

◆ deleteExpiredCountersAgent()

static deleteExpiredCountersAgent ( )
static

См. определение в файле CounterService.php строка 432

◆ deleteTo()

deleteTo ( Message $message)

См. определение в файле CounterService.php строка 394

◆ get()

get ( )

См. определение в файле CounterService.php строка 110

◆ getAdditionalCounters()

getAdditionalCounters ( ?array $chatIds = null,
bool $forCurrentUser = true )
protected

См. определение в файле CounterService.php строка 643

◆ getByChat()

getByChat ( int $chatId)

См. определение в файле CounterService.php строка 105

◆ getByChatForEachUsers()

getByChatForEachUsers ( int $chatId,
?array $userIds = null )

См. определение в файле CounterService.php строка 79

◆ getCacheForChatsCounters()

getCacheForChatsCounters ( )
protected

См. определение в файле CounterService.php строка 491

◆ getCacheForPreparedCounters()

getCacheForPreparedCounters ( )
protected

См. определение в файле CounterService.php строка 482

◆ getCountersForEachChat()

getCountersForEachChat ( ?array $chatIds = null,
bool $forCurrentUser = true )
protected

См. определение в файле CounterService.php строка 623

◆ getCountUnreadMessagesByChatId()

getCountUnreadMessagesByChatId ( int $chatId)
protected

См. определение в файле CounterService.php строка 694

◆ getCountUnreadMessagesByChatIdForEachUsers()

getCountUnreadMessagesByChatIdForEachUsers ( int $chatId,
?array $userIds = null )
protected

См. определение в файле CounterService.php строка 678

◆ getForEachChat()

getForEachChat ( ?array $chatIds = null)

См. определение в файле CounterService.php строка 139

◆ getForNotifyChat()

getForNotifyChat ( )

См. определение в файле CounterService.php строка 178

◆ getForNotifyChats()

getForNotifyChats ( array $chatIds)

См. определение в файле CounterService.php строка 192

◆ getIdFirstUnreadMessage()

getIdFirstUnreadMessage ( int $chatId)

См. определение в файле CounterService.php строка 217

◆ getIdFirstUnreadMessageForEachChats()

getIdFirstUnreadMessageForEachChats ( array $chatIds)

См. определение в файле CounterService.php строка 230

◆ getTotal()

getTotal ( )

См. определение в файле CounterService.php строка 71

◆ getTotalCountUnreadMessages()

getTotalCountUnreadMessages ( )
protected

См. определение в файле CounterService.php строка 666

◆ getUnreadChats()

getUnreadChats ( ?bool $isMuted = null)
protected

Переопределяется в CounterServiceLegacy.

См. определение в файле CounterService.php строка 608

◆ haveInSpecificChatsCache()

haveInSpecificChatsCache ( array $chatIds)
protected

См. определение в файле CounterService.php строка 705

◆ onAfterUserUpdate()

static onAfterUserUpdate ( array $fields)
static

См. определение в файле CounterService.php строка 401

◆ onFireUser()

static onFireUser ( int $userId)
staticprotected

См. определение в файле CounterService.php строка 441

◆ onHireUser()

static onHireUser ( int $userId)
staticprotected

См. определение в файле CounterService.php строка 454

◆ saveChatsCountersInCache()

saveChatsCountersInCache ( Cache $cache)
protected

См. определение в файле CounterService.php строка 507

◆ savePreparedCountersInCache()

savePreparedCountersInCache ( Cache $cache)
protected

См. определение в файле CounterService.php строка 500

◆ saveSpecificChatsCountersInCache()

saveSpecificChatsCountersInCache ( array $chatIds)
protected

См. определение в файле CounterService.php строка 514

◆ setFromChat()

setFromChat ( int $id,
int $count )
protected

См. определение в файле CounterService.php строка 601

◆ setFromCopilot()

setFromCopilot ( int $id,
int $count )
protected

См. определение в файле CounterService.php строка 595

◆ setFromLine()

setFromLine ( int $id,
int $count )
protected

См. определение в файле CounterService.php строка 588

◆ setFromMutedChat()

setFromMutedChat ( int $id,
int $count )
protected

См. определение в файле CounterService.php строка 577

◆ setFromNotify()

setFromNotify ( int $count)
protected

См. определение в файле CounterService.php строка 582

◆ setUnreadChat()

setUnreadChat ( int $id,
bool $isMuted )
protected

См. определение в файле CounterService.php строка 566

◆ updateIsMuted()

updateIsMuted ( int $chatId,
string $isMuted )

См. определение в файле CounterService.php строка 255

Данные класса

◆ $counters

array $counters
protected

См. определение в файле CounterService.php строка 56

◆ $countersByChatIds

array $countersByChatIds = []
protected

См. определение в файле CounterService.php строка 57

◆ $staticChatsCounterCache

array $staticChatsCounterCache = []
staticprotected

См. определение в файле CounterService.php строка 53

◆ $staticCounterCache

array $staticCounterCache = []
staticprotected

См. определение в файле CounterService.php строка 52

◆ $staticSpecificChatsCounterCache

array $staticSpecificChatsCounterCache = []
staticprotected

См. определение в файле CounterService.php строка 54

◆ CACHE_CHATS_COUNTERS_NAME

const CACHE_CHATS_COUNTERS_NAME = 'chats_counter_v6'
protected

См. определение в файле CounterService.php строка 34

◆ CACHE_NAME

const CACHE_NAME = 'counter_v5'
protected

См. определение в файле CounterService.php строка 33

◆ CACHE_PATH

const CACHE_PATH = '/bx/im/v2/counter/'
protected

См. определение в файле CounterService.php строка 35

◆ CACHE_TTL

const CACHE_TTL = 86400
protected

См. определение в файле CounterService.php строка 32

◆ DEFAULT_COUNTERS

const DEFAULT_COUNTERS
protected
Инициализатор
= [
'TYPE' => [
'ALL' => 0,
'NOTIFY' => 0,
'CHAT' => 0,
'LINES' => 0,
'COPILOT' => 0,
],
'CHAT' => [],
'CHAT_MUTED' => [],
'CHAT_UNREAD' => [],
'LINES' => [],
'COPILOT' => [],
]

См. определение в файле CounterService.php строка 37

◆ DELAY_DELETION_COUNTERS_OF_FIRED_USER

const DELAY_DELETION_COUNTERS_OF_FIRED_USER = 604800
protected

См. определение в файле CounterService.php строка 29

◆ EXPIRY_INTERVAL

const EXPIRY_INTERVAL = '-12 months'
protected

См. определение в файле CounterService.php строка 30