本文整理汇总了PHP中CacheManager::getUserByID方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheManager::getUserByID方法的具体用法?PHP CacheManager::getUserByID怎么用?PHP CacheManager::getUserByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CacheManager
的用法示例。
在下文中一共展示了CacheManager::getUserByID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: transferDynamic
private function transferDynamic($dynamics)
{
$temp = array();
foreach ($dynamics as $dynamic) {
$user = CacheManager::getUserByID($dynamic['author_id']);
if (isset($user) && !is_null($user)) {
switch ($dynamic['dynamic_type']) {
case Constants::DYNAMIC_TYPE_WATCH:
$temp[] = array('type' => 'watch', 'user_id' => $user->id, 'user_name' => $user->nickname, 'user_pic_url' => $user->user_pic_url, 'create_date' => $dynamic['create_date'], 'prod_type' => $dynamic['content_type'], 'prod_name' => $dynamic['content_name'], 'prod_poster' => $dynamic['content_pic_url'], 'prod_id' => $dynamic['content_id']);
break;
case Constants::DYNAMIC_TYPE_SHARE:
$temp[] = array('type' => 'share', 'user_id' => $user->id, 'user_name' => $user->nickname, 'user_pic_url' => $user->user_pic_url, 'create_date' => $dynamic['create_date'], 'prod_type' => $dynamic['content_type'], 'prod_name' => $dynamic['content_name'], 'prod_poster' => $dynamic['content_pic_url'], 'prod_id' => $dynamic['content_id'], 'share_where_type' => $dynamic['content_desc']);
break;
case Constants::DYNAMIC_TYPE_COMMENTS:
$temp[] = array('type' => 'comment', 'user_id' => $user->id, 'user_name' => $user->nickname, 'user_pic_url' => $user->user_pic_url, 'create_date' => $dynamic['create_date'], 'prod_type' => $dynamic['content_type'], 'prod_name' => $dynamic['content_name'], 'prod_poster' => $dynamic['content_pic_url'], 'prod_id' => $dynamic['content_id'], 'content' => $dynamic['content_desc']);
break;
case Constants::DYNAMIC_TYPE_FAVORITY:
$temp[] = array('type' => 'favority', 'user_id' => $user->id, 'user_name' => $user->nickname, 'user_pic_url' => $user->user_pic_url, 'create_date' => $dynamic['create_date'], 'prod_type' => $dynamic['content_type'], 'prod_name' => $dynamic['content_name'], 'prod_poster' => $dynamic['content_pic_url'], 'prod_id' => $dynamic['content_id']);
break;
case Constants::DYNAMIC_TYPE_LIKE:
$temp[] = array('type' => 'like', 'user_id' => $user->id, 'user_name' => $user->nickname, 'user_pic_url' => $user->user_pic_url, 'create_date' => $dynamic['create_date'], 'prod_type' => $dynamic['content_type'], 'prod_name' => $dynamic['content_name'], 'prod_poster' => $dynamic['content_pic_url'], 'prod_id' => $dynamic['content_id']);
break;
case Constants::DYNAMIC_TYPE_PUBLISH_PROGRAM:
$temp[] = array('type' => 'publish', 'user_id' => $user->id, 'user_name' => $user->nickname, 'user_pic_url' => $user->user_pic_url, 'create_date' => $dynamic['create_date'], 'prod_type' => $dynamic['content_type'], 'prod_name' => $dynamic['content_name'], 'prod_poster' => $dynamic['content_pic_url'], 'prod_id' => $dynamic['content_id']);
break;
case Constants::DYNAMIC_TYPE_UN_FAVORITY:
$temp[] = array('type' => 'unfavority', 'user_id' => $user->id, 'user_name' => $user->nickname, 'user_pic_url' => $user->user_pic_url, 'create_date' => $dynamic['create_date'], 'prod_type' => $dynamic['content_type'], 'prod_name' => $dynamic['content_name'], 'prod_poster' => $dynamic['content_pic_url'], 'prod_id' => $dynamic['content_id']);
break;
case Constants::DYNAMIC_TYPE_COMMENT_REPLI:
$prod = CacheManager::getCommentProgram($dynamic['content_id']);
$temp[] = array('type' => 'reply', 'user_id' => $user->id, 'user_name' => $user->nickname, 'user_pic_url' => $user->user_pic_url, 'create_date' => $dynamic['create_date'], 'prod_type' => $prod['type'], 'prod_id' => $prod['id'], 'prod_name' => $prod['name'], 'prod_poster' => $prod['poster'], 'thread_id' => $dynamic['content_id'], 'thread_comment' => CacheManager::getCommentContent($dynamic['content_id']), 'content' => $dynamic['content_desc']);
break;
case Constants::DYNAMIC_TYPE_FOLLOW:
$temp[] = array('type' => 'follow', 'user_id' => $user->id, 'user_name' => $user->nickname, 'user_pic_url' => $user->user_pic_url, 'create_date' => $dynamic['create_date'], 'friend_name' => $dynamic['content_name'], 'friend_pic_url' => $dynamic['content_pic_url'], 'friend_id' => $dynamic['content_id']);
break;
// case Constants::DYNAMIC_TYPE_LIKE_FRIEND:
// $temp[] = array(
// 'type'=>'like_person',
// 'user_id'=>$user->id,
// 'user_name'=>$user->nickname,
// 'user_pic_url'=>$user->user_pic_url,
// 'create_date'=>$dynamic['create_date'],
// 'friend_name'=>$dynamic['content_name'],
// 'friend_pic_url'=>$dynamic['content_pic_url'],
// 'friend_id'=>$dynamic['content_id'],
// );
// break;
// case Constants::DYNAMIC_TYPE_LIKE_FRIEND:
// $temp[] = array(
// 'type'=>'like_person',
// 'user_id'=>$user->id,
// 'user_name'=>$user->nickname,
// 'user_pic_url'=>$user->user_pic_url,
// 'create_date'=>$dynamic['create_date'],
// 'friend_name'=>$dynamic['content_name'],
// 'friend_pic_url'=>$dynamic['content_pic_url'],
// 'friend_id'=>$dynamic['content_id'],
// );
// break;
case Constants::DYNAMIC_TYPE_UN_FOLLOW:
$temp[] = array('type' => 'destory', 'user_id' => $user->id, 'user_name' => $user->nickname, 'user_pic_url' => $user->user_pic_url, 'create_date' => $dynamic['create_date'], 'friend_name' => $dynamic['content_name'], 'friend_pic_url' => $dynamic['content_pic_url'], 'friend_id' => $dynamic['content_id']);
break;
case Constants::DYNAMIC_TYPE_RECOMMEND:
$temp[] = array('type' => 'recommend', 'user_id' => $user->id, 'user_name' => $user->nickname, 'user_pic_url' => $user->user_pic_url, 'create_date' => $dynamic['create_date'], 'prod_type' => $dynamic['content_type'], 'prod_name' => $dynamic['content_name'], 'prod_poster' => $dynamic['content_pic_url'], 'prod_id' => $dynamic['content_id'], 'reason' => $dynamic['content_desc']);
break;
}
}
}
return $temp;
}