PHP Class WebMessageModel, thinksns

Author: xiewei ([email protected])
Afficher le fichier Open project: medz/thinksns-4

Protected Properties

Свойство Type Description
$member
$models
$room
$userId

Méthodes publiques

Méthode Description
__construct ( )
addGroupMember ( $roomId, $memberUids ) : boolean 添加群成员
appendRoomListMember ( array $data ) : array | mixed
checkGroupPermissions ( integer $roomId, boolean $checkMaster = false, integer $type = 2 ) : boolean 检查群组权限
clearMessage ( $roomId, $type = 'unread' )
content ( ) : Model
createGroupRoom ( $uids, null $title = null ) : array | boolean
getClientByUser ( string | array $uids, boolean $removeCurrentUser = true ) : array 根据用户Id,获取全部客户端连接ID
getMessageList ( $roomId, $messageId = null, $direction = 'lt', $limit = null )
getMessageRoom ( $toUid ) : array | boolean
getRoomList ( $limit = null, $page = true, $appendMember = false )
getRoomMember ( $roomId )
getUserId ( )
hasRoom ( $roomId )
member ( ) : Model
model ( $name, null $propName = null ) : Model
parseMessage ( array $list ) : array 将消息列表整理为标准的返回格式
push ( )
pushMessage ( $toUids, $data ) TODO JPush Code
quitGroupRoom ( integer $roomId ) : boolean 主动退出群房间
refreshRoomMember ( integer $roomId, boolean $changeMaster = false ) : integer 刷新房间成员信息
removeGroupMember ( $roomId, $memberUids ) : boolean 删除群成员
room ( ) : Model
roomHasUser ( $roomId, $uid, $checkRoom = false )
sendMessage ( array $message, $isNotify = false, $isPush = true )
setRoom ( $roomId, $data ) : boolean 设置房间信息
setUserId ( $userId )
table ( $table )
ucmap ( )

Méthodes protégées

Méthode Description
formatInList ( array | string $ints, string $default = '', boolean $unique = true ) : string 将一个包含id列表的数组或字符串格式化为标准的逗号分隔值
getUserList ( $uids )
htmlDecode ( string $string, integer $flags = ENT_QUOTES ) : string html编码,默认包括单引号
htmlEncode ( string $string, integer $flags = ENT_QUOTES, $charset = 'UTF-8' ) : string html编码,默认包括单引号

Method Details

__construct() public méthode

public __construct ( )

addGroupMember() public méthode

添加群成员
public addGroupMember ( $roomId, $memberUids ) : boolean
$memberUids
Résultat boolean

appendRoomListMember() public méthode

public appendRoomListMember ( array $data ) : array | mixed
$data array
Résultat array | mixed

checkGroupPermissions() public méthode

检查群组权限
public checkGroupPermissions ( integer $roomId, boolean $checkMaster = false, integer $type = 2 ) : boolean
$roomId integer 房间ID
$checkMaster boolean 是否检查uid为群主
$type integer 群房间类型 null 为不限制
Résultat boolean

clearMessage() public méthode

public clearMessage ( $roomId, $type = 'unread' )

content() public méthode

public content ( ) : Model
Résultat Model

createGroupRoom() public méthode

public createGroupRoom ( $uids, null $title = null ) : array | boolean
$uids
$title null
Résultat array | boolean

formatInList() protected static méthode

将一个包含id列表的数组或字符串格式化为标准的逗号分隔值
protected static formatInList ( array | string $ints, string $default = '', boolean $unique = true ) : string
$ints array | string 需要整理的id列表
$default string 如果列表中没有符合的ID,则返回此值
$unique boolean 是否需要去除重复
Résultat string 整理好的字符串,如果没有则返回默认值

getClientByUser() public méthode

根据用户Id,获取全部客户端连接ID
public getClientByUser ( string | array $uids, boolean $removeCurrentUser = true ) : array
$uids string | array 用户ID列表,逗号分隔或一个数组
$removeCurrentUser boolean 如果为false,那么如果查询结果有当前用户将会保留
Résultat array 返回一个包含指定用户id的客户端连接Id数组

getMessageList() public méthode

public getMessageList ( $roomId, $messageId = null, $direction = 'lt', $limit = null )

getMessageRoom() public méthode

public getMessageRoom ( $toUid ) : array | boolean
$toUid
Résultat array | boolean

getRoomList() public méthode

public getRoomList ( $limit = null, $page = true, $appendMember = false )

getRoomMember() public méthode

public getRoomMember ( $roomId )

getUserId() public méthode

public getUserId ( )

getUserList() protected méthode

protected getUserList ( $uids )
$uids

hasRoom() public méthode

public hasRoom ( $roomId )

htmlDecode() protected static méthode

html编码,默认包括单引号
protected static htmlDecode ( string $string, integer $flags = ENT_QUOTES ) : string
$string string
$flags integer
Résultat string

htmlEncode() protected static méthode

html编码,默认包括单引号
protected static htmlEncode ( string $string, integer $flags = ENT_QUOTES, $charset = 'UTF-8' ) : string
$string string
$flags integer
Résultat string

member() public méthode

public member ( ) : Model
Résultat Model

model() public méthode

public model ( $name, null $propName = null ) : Model
$name
$propName null
Résultat Model

parseMessage() public méthode

将消息列表整理为标准的返回格式
public parseMessage ( array $list ) : array
$list array 需要整理的消息列表
Résultat array 返回整理好的消息列表

push() public méthode

public push ( )

pushMessage() public méthode

TODO JPush Code
public pushMessage ( $toUids, $data )

quitGroupRoom() public méthode

主动退出群房间
public quitGroupRoom ( integer $roomId ) : boolean
$roomId integer 房间ID
Résultat boolean

refreshRoomMember() public méthode

刷新房间成员信息
public refreshRoomMember ( integer $roomId, boolean $changeMaster = false ) : integer
$roomId integer 房间ID
$changeMaster boolean
Résultat integer 返回群成员数量

removeGroupMember() public méthode

删除群成员
public removeGroupMember ( $roomId, $memberUids ) : boolean
$roomId
$memberUids
Résultat boolean

room() public méthode

public room ( ) : Model
Résultat Model

roomHasUser() public méthode

public roomHasUser ( $roomId, $uid, $checkRoom = false )

sendMessage() public méthode

public sendMessage ( array $message, $isNotify = false, $isPush = true )
$message array

setRoom() public méthode

设置房间信息
public setRoom ( $roomId, $data ) : boolean
$roomId
$data
Résultat boolean

setUserId() public méthode

public setUserId ( $userId )

table() public méthode

public table ( $table )

ucmap() public méthode

public ucmap ( )

Property Details

$member protected_oe property

protected $member

$models protected_oe property

protected $models

$room protected_oe property

protected $room

$userId protected_oe property

protected $userId