PHP Class FollowModel, thinksns

Mostrar archivo Open project: medz/thinksns-4 Class Usage Examples

Protected Properties

Property Type Description
$fields
$tableName

Public Methods

Method Description
bulkDoFollow ( $uid, $fids )
doFollow ( integer $uid, integer $fid ) : boolean 添加关注 (关注用户)
eachDoFollow ( integer $uid, array $fids ) : boolean 双向关注用户操作
getFollowCount ( array $uids ) : array 获取指定用户的关注与粉丝数
getFollowState ( integer $uid, integer $fid ) : integer 获取用户uid与用户fid的关注状态,已uid为主
getFollowStateByFids ( integer $uid, array $fids ) : array 批量获取用户uid与一群人fids的彼此关注状态
getFollowerList ( integer $uid, integer $limit = 10 ) : array 获取指定用户的粉丝列表
getFollowerListForApi ( integer $mid, integer $uid, integer $since_id, integer $max_id, integer $limit = 20, integer $page = 1 ) : array 获取指定用户粉丝列表,API使用
getFollowingList ( integer $uid, integer $gid = null, integer $limit = 10 ) : array 获取指定用户的关注列表 分页
getFollowingListAll ( integer $uid, integer $gid = null ) : array 获取指定用户的关注列表 不分页
getFollowingListForApi ( integer $mid, integer $uid, integer $since_id, integer $max_id, integer $limit = 20, integer $page = 1 ) : array 获取指定用户关注列表,API使用
getFollowingSql ( integer $uid ) : string 获取关注查询SQL语句,具体使用不清楚
getFollowingsList ( integer $uid ) : array 获取所有关注用户数据
getFriendsData ( integer $uid ) : array 获取朋友列表数据 - 不分页
getFriendsForApi ( integer $mid, integer $uid, integer $since_id, integer $max_id, integer $limit = 20, integer $page = 1 ) : array 获取指定用户的朋友列表,API专用
getFriendsList ( integer $uid ) : array 获取朋友列表数据 - 分页
getLastError ( ) : string 获取最后的错误信息
getRemarkHash ( integer $uid ) : array 获取指定用户的备注列表
getfollowList ( $uid ) ***************************************************ts2.XX 应用移动新增函数
searchFollows ( string $key, string $type, integer $limit = 20, integer $uid, integer $gid ) : array 数据库搜索关注用户
unFollow ( integer $uid, integer $fid ) : boolean 取消关注(关注用户 / 关注话题)

Private Methods

Method Description
_formatFollowState ( integer $uid, array $fids, array $follow_data ) : array 格式化,用户的关注数据
_updateFollowCount ( integer $uid, array $fids, boolean $inc = true ) 更新关注数目

Method Details

bulkDoFollow() public method

public bulkDoFollow ( $uid, $fids )

doFollow() public method

添加关注 (关注用户)
public doFollow ( integer $uid, integer $fid ) : boolean
$uid integer 发起操作的用户ID
$fid integer 被关注的用户ID或被关注的话题ID
return boolean 是否关注成功

eachDoFollow() public method

双向关注用户操作
public eachDoFollow ( integer $uid, array $fids ) : boolean
$uid integer 用户ID
$fids array 需关注用户ID数组
return boolean 是否双向关注成功

getFollowCount() public method

获取指定用户的关注与粉丝数
public getFollowCount ( array $uids ) : array
$uids array 用户ID数组
return array 指定用户的关注与粉丝数

getFollowState() public method

获取用户uid与用户fid的关注状态,已uid为主
public getFollowState ( integer $uid, integer $fid ) : integer
$uid integer 用户ID
$fid integer 用户ID
return integer 用户关注状态,格式为array('following'=>1,'follower'=>1)

getFollowStateByFids() public method

批量获取用户uid与一群人fids的彼此关注状态
public getFollowStateByFids ( integer $uid, array $fids ) : array
$uid integer 用户ID
$fids array 用户ID数组
return array 用户uid与一群人fids的彼此关注状态

getFollowerList() public method

获取指定用户的粉丝列表
public getFollowerList ( integer $uid, integer $limit = 10 ) : array
$uid integer 用户ID
$limit integer 结果集数目,默认为10
return array 指定用户的粉丝列表

getFollowerListForApi() public method

获取指定用户粉丝列表,API使用
public getFollowerListForApi ( integer $mid, integer $uid, integer $since_id, integer $max_id, integer $limit = 20, integer $page = 1 ) : array
$mid integer 当前登录用户ID
$uid integer 指定用户ID
$since_id integer 主键起始ID,默认为0
$max_id integer 主键最大ID,默认为0
$limit integer 结果集数目,默认为20
$page integer 页数ID,默认为1
return array 指定用户的粉丝列表数据

getFollowingList() public method

获取指定用户的关注列表 分页
public getFollowingList ( integer $uid, integer $gid = null, integer $limit = 10 ) : array
$uid integer 用户ID
$gid integer 关注组ID,默认为空
$limit integer 结果集数目,默认为10
return array 指定用户的关注列表

getFollowingListAll() public method

获取指定用户的关注列表 不分页
public getFollowingListAll ( integer $uid, integer $gid = null ) : array
$uid integer 用户ID
$gid integer 关注组ID,默认为空
return array 指定用户的关注列表

getFollowingListForApi() public method

获取指定用户关注列表,API使用
public getFollowingListForApi ( integer $mid, integer $uid, integer $since_id, integer $max_id, integer $limit = 20, integer $page = 1 ) : array
$mid integer 当前登录用户ID
$uid integer 指定用户ID
$since_id integer 主键起始ID,默认为0
$max_id integer 主键最大ID,默认为0
$limit integer 结果集数目,默认为20
$page integer 页数ID,默认为1
return array 指定用户的关注列表数据

getFollowingSql() public method

获取关注查询SQL语句,具体使用不清楚
public getFollowingSql ( integer $uid ) : string
$uid integer 用户ID
return string 关注查询SQL语句

getFollowingsList() public method

获取所有关注用户数据
public getFollowingsList ( integer $uid ) : array
$uid integer 用户ID
return array 所有关注用户数据

getFriendsData() public method

获取朋友列表数据 - 不分页
public getFriendsData ( integer $uid ) : array
$uid integer 用户ID
return array 朋友列表数据

getFriendsForApi() public method

获取指定用户的朋友列表,API专用
public getFriendsForApi ( integer $mid, integer $uid, integer $since_id, integer $max_id, integer $limit = 20, integer $page = 1 ) : array
$mid integer 当前登录用户ID
$uid integer 指定用户ID
$since_id integer 主键起始ID,默认为0
$max_id integer 主键最大ID,默认为0
$limit integer 结果集数目,默认为20
$page integer 页数ID,默认为1
return array 指定用户的朋友列表

getFriendsList() public method

获取朋友列表数据 - 分页
public getFriendsList ( integer $uid ) : array
$uid integer 用户ID
return array 朋友列表数据

getLastError() public method

获取最后的错误信息
public getLastError ( ) : string
return string 最后的错误信息

getRemarkHash() public method

获取指定用户的备注列表
public getRemarkHash ( integer $uid ) : array
$uid integer 用户ID
return array 指定用户的备注列表

getfollowList() public method

***************************************************ts2.XX 应用移动新增函数
public getfollowList ( $uid )

searchFollows() public method

数据库搜索关注用户
public searchFollows ( string $key, string $type, integer $limit = 20, integer $uid, integer $gid ) : array
$key string 关键字
$type string 关键字,following,follower
$limit integer 结果集数目
$uid integer 指定用户UID
$gid integer 分组ID
return array 搜索后的数据

unFollow() public method

取消关注(关注用户 / 关注话题)
public unFollow ( integer $uid, integer $fid ) : boolean
$uid integer 发起操作的用户ID
$fid integer 被取消关注的用户ID或被取消关注的话题ID
return boolean 是否取消关注成功

Property Details

$fields protected_oe property

protected $fields

$tableName protected_oe property

protected $tableName