PHP Класс erLhcoreClassChat

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$chatListIgnoreField
$onlineCondition
$trackActivity Static attribute for class
$trackTimeout

Открытые методы

Метод Описание
canReopen ( erLhcoreClassModelChat $chat, $skipStatusCheck = false )
canReopenDirectly ( $params = [] )
closeChatCallback ( $chat, $operator = false )
formatDate ( $ts )
formatSeconds ( $seconds )
generateHash ( )
getActiveChats ( $limit = 50, $offset, $filterAdditional = [] )
getActiveChatsCount ( $filterAdditional = [] )
getAdjustment ( $geo_adjustment, $onlineUserVid = '', $widgetMode = false, $onlineUserDefined = false )
getChatDurationToUpdateChatID ( $chatID )
getChatMessages ( $chat_id ) Gets chats messages, used to review chat etc.
getClosedChats ( $limit = 50, $offset, $filterAdditional = [] )
getClosedChatsCount ( $filterAdditional = [] )
getCount ( $params = [], $table = 'lh_chat', $operation = 'COUNT(id)' )
getDepartmentLimitation ( $tableName = 'lh_chat', $params = [] )
getFirstUserMessage ( $chat_id ) Get first user mesasge for prefilling chat
getGetLastChatMessage ( $chat_id ) Get last message for chatbox
getGetLastChatMessageEdit ( $chat_id, $user_id ) Get last message for chat editing admin last message
getGetLastChatMessagePending ( $chat_id ) Get last message for browser notification
getList ( $paramsSearch = [], $class = 'erLhcoreClassModelChat', $tableName = 'lh_chat' )
getLoggedDepartmentsIds ( $departmentsIds, $exclipic = false ) Returns departments with atleast one logged
getOnlineUsers ( $UserID = [], $params = [] )
getOperatorsChats ( $limit = 50, $offset, $filterAdditional = [] )
getOperatorsChatsCount ( $filterAdditional = [] )
getPendingChats ( $limit = 50, $offset, $filterAdditional = [], $filterAdditionalMainAttr = [], $limitationDepartment = [] ) Gets pending chats
getPendingChatsCount ( $filterAdditional = [] )
getPendingChatsCountPublic ( $department = false )
getPendingMessages ( $chat_id, $message_id ) All messages, which should get administrator/user
getPendingMessagesChatbox ( $chat_id, $message_id ) All messages, which should get administrator/user for chatbox
getRandomOnlineUserID ( $params = [] )
getSession ( )
getUnreadMessagesChats ( $limit = 10, $offset, $filterAdditional = [] ) Get's unread messages from users
getUnreadMessagesChatsCount ( $filterAdditional = [] ) Get's unread messages from users | COUNT
hasAccessToRead ( $chat )
isChatActive ( $chat_id, $hash ) Is chat activated and user can send messages.
isOnline ( $dep_id = false, $exclipic = false, $params = [] )
isOnlineUser ( $user_id, $params = [] )
prefillGetAttributes ( &$objects, $attrs = [], $attrRemove = [], $params = [] ) Is there any better way to initialize __get variables?
prefillGetAttributesObject ( &$object, $attrs = [], $attrRemove = [], $params = [] ) Is there any better way to initialize __get variables?
prefillObjects ( &$objects, $attrs = [], $params = [] ) * Example of call This method can prefill first and second level objects without requirement for each object to be fetched separately Increases performance drastically erLhcoreClassModuleFunctions::prefillObjects($items, array( array( 'order_id', 'order', 'dommyClass::getList' ), array( 'status_id', 'status', 'dommyClass::getList' ), array( array( 'order', 'registration_id' ), array( 'order', 'registration' ), 'dommyClass::getList', 'id' ) ));
safe_json_encode ( array $value )
setActivityByChatAndOnlineUser ( $chat, erLhcoreClassModelChatOnlineUser $onlineUser ) : integer
setOnlineStatus ( $chatLists ) Sets chat's status by online visitors records in efficient way
setOnlineStatusDirectly ( $chatLists ) Sets chats status directly
setTimeZoneByChat ( $chat )
updateActiveChats ( $user_id )
updateDepartmentStats ( $dep ) Update department main statistic for frontend
utf8ize ( unknown $mixed ) : string Make conversion if required
validateFilterIn ( &$params )

Описание методов

canReopen() публичный статический Метод

public static canReopen ( erLhcoreClassModelChat $chat, $skipStatusCheck = false )
$chat erLhcoreClassModelChat

canReopenDirectly() публичный статический Метод

public static canReopenDirectly ( $params = [] )

closeChatCallback() публичный статический Метод

public static closeChatCallback ( $chat, $operator = false )

formatDate() публичный статический Метод

public static formatDate ( $ts )

formatSeconds() публичный статический Метод

public static formatSeconds ( $seconds )

generateHash() публичный статический Метод

public static generateHash ( )

getActiveChats() публичный статический Метод

public static getActiveChats ( $limit = 50, $offset, $filterAdditional = [] )

getActiveChatsCount() публичный статический Метод

public static getActiveChatsCount ( $filterAdditional = [] )

getAdjustment() публичный статический Метод

public static getAdjustment ( $geo_adjustment, $onlineUserVid = '', $widgetMode = false, $onlineUserDefined = false )

getChatDurationToUpdateChatID() публичный статический Метод

public static getChatDurationToUpdateChatID ( $chatID )

getChatMessages() публичный статический Метод

Gets chats messages, used to review chat etc.
public static getChatMessages ( $chat_id )

getClosedChats() публичный статический Метод

public static getClosedChats ( $limit = 50, $offset, $filterAdditional = [] )

getClosedChatsCount() публичный статический Метод

public static getClosedChatsCount ( $filterAdditional = [] )

getCount() публичный статический Метод

public static getCount ( $params = [], $table = 'lh_chat', $operation = 'COUNT(id)' )

getDepartmentLimitation() публичный статический Метод

public static getDepartmentLimitation ( $tableName = 'lh_chat', $params = [] )

getFirstUserMessage() публичный статический Метод

Get first user mesasge for prefilling chat
public static getFirstUserMessage ( $chat_id )

getGetLastChatMessage() публичный статический Метод

Get last message for chatbox
public static getGetLastChatMessage ( $chat_id )

getGetLastChatMessageEdit() публичный статический Метод

Get last message for chat editing admin last message
public static getGetLastChatMessageEdit ( $chat_id, $user_id )

getGetLastChatMessagePending() публичный статический Метод

Get last message for browser notification
public static getGetLastChatMessagePending ( $chat_id )

getList() публичный статический Метод

public static getList ( $paramsSearch = [], $class = 'erLhcoreClassModelChat', $tableName = 'lh_chat' )

getLoggedDepartmentsIds() публичный статический Метод

Returns departments with atleast one logged
public static getLoggedDepartmentsIds ( $departmentsIds, $exclipic = false )

getOnlineUsers() публичный статический Метод

public static getOnlineUsers ( $UserID = [], $params = [] )

getOperatorsChats() публичный статический Метод

public static getOperatorsChats ( $limit = 50, $offset, $filterAdditional = [] )

getOperatorsChatsCount() публичный статический Метод

public static getOperatorsChatsCount ( $filterAdditional = [] )

getPendingChats() публичный статический Метод

Gets pending chats
public static getPendingChats ( $limit = 50, $offset, $filterAdditional = [], $filterAdditionalMainAttr = [], $limitationDepartment = [] )

getPendingChatsCount() публичный статический Метод

public static getPendingChatsCount ( $filterAdditional = [] )

getPendingChatsCountPublic() публичный статический Метод

public static getPendingChatsCountPublic ( $department = false )

getPendingMessages() публичный статический Метод

All messages, which should get administrator/user
public static getPendingMessages ( $chat_id, $message_id )

getPendingMessagesChatbox() публичный статический Метод

All messages, which should get administrator/user for chatbox
public static getPendingMessagesChatbox ( $chat_id, $message_id )

getRandomOnlineUserID() публичный статический Метод

public static getRandomOnlineUserID ( $params = [] )

getSession() публичный статический Метод

public static getSession ( )

getUnreadMessagesChats() публичный статический Метод

Get's unread messages from users
public static getUnreadMessagesChats ( $limit = 10, $offset, $filterAdditional = [] )

getUnreadMessagesChatsCount() публичный статический Метод

Get's unread messages from users | COUNT
public static getUnreadMessagesChatsCount ( $filterAdditional = [] )

hasAccessToRead() публичный статический Метод

public static hasAccessToRead ( $chat )

isChatActive() публичный статический Метод

Is chat activated and user can send messages.
public static isChatActive ( $chat_id, $hash )

isOnline() публичный статический Метод

public static isOnline ( $dep_id = false, $exclipic = false, $params = [] )

isOnlineUser() публичный статический Метод

public static isOnlineUser ( $user_id, $params = [] )

prefillGetAttributes() публичный статический Метод

Is there any better way to initialize __get variables?
public static prefillGetAttributes ( &$objects, $attrs = [], $attrRemove = [], $params = [] )

prefillGetAttributesObject() публичный статический Метод

Is there any better way to initialize __get variables?
public static prefillGetAttributesObject ( &$object, $attrs = [], $attrRemove = [], $params = [] )

prefillObjects() публичный статический Метод

* Example of call This method can prefill first and second level objects without requirement for each object to be fetched separately Increases performance drastically erLhcoreClassModuleFunctions::prefillObjects($items, array( array( 'order_id', 'order', 'dommyClass::getList' ), array( 'status_id', 'status', 'dommyClass::getList' ), array( array( 'order', 'registration_id' ), array( 'order', 'registration' ), 'dommyClass::getList', 'id' ) ));
public static prefillObjects ( &$objects, $attrs = [], $params = [] )

safe_json_encode() публичный статический Метод

См. также: https://github.com/LiveHelperChat/livehelperchat/pull/809
public static safe_json_encode ( array $value )
$value array

setActivityByChatAndOnlineUser() публичный статический Метод

public static setActivityByChatAndOnlineUser ( $chat, erLhcoreClassModelChatOnlineUser $onlineUser ) : integer
$onlineUser erLhcoreClassModelChatOnlineUser
Результат integer

setOnlineStatus() публичный статический Метод

Sets chat's status by online visitors records in efficient way
public static setOnlineStatus ( $chatLists )

setOnlineStatusDirectly() публичный статический Метод

Sets chats status directly
public static setOnlineStatusDirectly ( $chatLists )

setTimeZoneByChat() публичный статический Метод

public static setTimeZoneByChat ( $chat )

updateActiveChats() публичный статический Метод

public static updateActiveChats ( $user_id )

updateDepartmentStats() публичный статический Метод

Update department main statistic for frontend
public static updateDepartmentStats ( $dep )

utf8ize() публичный статический Метод

Make conversion if required
public static utf8ize ( unknown $mixed ) : string
$mixed unknown
Результат string

validateFilterIn() публичный статический Метод

public static validateFilterIn ( &$params )

Описание свойств

$chatListIgnoreField публичное статическое свойство

public static $chatListIgnoreField

$onlineCondition публичное статическое свойство

public static $onlineCondition

$trackActivity публичное статическое свойство

Static attribute for class
public static $trackActivity

$trackTimeout публичное статическое свойство

public static $trackTimeout