PHP Class erLhcoreClassChat

Show file Open project: remdex/livehelperchat Class Usage Examples

Public Properties

Property Type Description
$chatListIgnoreField
$onlineCondition
$trackActivity Static attribute for class
$trackTimeout

Public Methods

Method Description
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 )

Method Details

canReopen() public static method

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

canReopenDirectly() public static method

public static canReopenDirectly ( $params = [] )

closeChatCallback() public static method

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

formatDate() public static method

public static formatDate ( $ts )

formatSeconds() public static method

public static formatSeconds ( $seconds )

generateHash() public static method

public static generateHash ( )

getActiveChats() public static method

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

getActiveChatsCount() public static method

public static getActiveChatsCount ( $filterAdditional = [] )

getAdjustment() public static method

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

getChatDurationToUpdateChatID() public static method

public static getChatDurationToUpdateChatID ( $chatID )

getChatMessages() public static method

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

getClosedChats() public static method

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

getClosedChatsCount() public static method

public static getClosedChatsCount ( $filterAdditional = [] )

getCount() public static method

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

getDepartmentLimitation() public static method

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

getFirstUserMessage() public static method

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

getGetLastChatMessage() public static method

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

getGetLastChatMessageEdit() public static method

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

getGetLastChatMessagePending() public static method

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

getList() public static method

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

getLoggedDepartmentsIds() public static method

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

getOnlineUsers() public static method

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

getOperatorsChats() public static method

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

getOperatorsChatsCount() public static method

public static getOperatorsChatsCount ( $filterAdditional = [] )

getPendingChats() public static method

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

getPendingChatsCount() public static method

public static getPendingChatsCount ( $filterAdditional = [] )

getPendingChatsCountPublic() public static method

public static getPendingChatsCountPublic ( $department = false )

getPendingMessages() public static method

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

getPendingMessagesChatbox() public static method

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

getRandomOnlineUserID() public static method

public static getRandomOnlineUserID ( $params = [] )

getSession() public static method

public static getSession ( )

getUnreadMessagesChats() public static method

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

getUnreadMessagesChatsCount() public static method

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

hasAccessToRead() public static method

public static hasAccessToRead ( $chat )

isChatActive() public static method

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

isOnline() public static method

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

isOnlineUser() public static method

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

prefillGetAttributes() public static method

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

prefillGetAttributesObject() public static method

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

prefillObjects() public static method

* 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() public static method

See also: https://github.com/LiveHelperChat/livehelperchat/pull/809
public static safe_json_encode ( array $value )
$value array

setActivityByChatAndOnlineUser() public static method

public static setActivityByChatAndOnlineUser ( $chat, erLhcoreClassModelChatOnlineUser $onlineUser ) : integer
$onlineUser erLhcoreClassModelChatOnlineUser
return integer

setOnlineStatus() public static method

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

setOnlineStatusDirectly() public static method

Sets chats status directly
public static setOnlineStatusDirectly ( $chatLists )

setTimeZoneByChat() public static method

public static setTimeZoneByChat ( $chat )

updateActiveChats() public static method

public static updateActiveChats ( $user_id )

updateDepartmentStats() public static method

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

utf8ize() public static method

Make conversion if required
public static utf8ize ( unknown $mixed ) : string
$mixed unknown
return string

validateFilterIn() public static method

public static validateFilterIn ( &$params )

Property Details

$chatListIgnoreField public static property

public static $chatListIgnoreField

$onlineCondition public static property

public static $onlineCondition

$trackActivity public static property

Static attribute for class
public static $trackActivity

$trackTimeout public static property

public static $trackTimeout