当前位置: 首页>>代码示例>>PHP>>正文


PHP CacheManager::getUserByID方法代码示例

本文整理汇总了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;
 }
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:70,代码来源:UserController.php


注:本文中的CacheManager::getUserByID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。