本文整理汇总了PHP中CacheManager::getCommentCache方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheManager::getCommentCache方法的具体用法?PHP CacheManager::getCommentCache怎么用?PHP CacheManager::getCommentCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CacheManager
的用法示例。
在下文中一共展示了CacheManager::getCommentCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionView
function actionView()
{
header('Content-type: application/json');
if (!IjoyPlusServiceUtils::validateAPPKey()) {
IjoyPlusServiceUtils::exportServiceError(Constants::APP_KEY_INVALID);
return;
}
// if(Yii::app()->user->isGuest){
// IjoyPlusServiceUtils::exportServiceError(Constants::SEESION_IS_EXPIRED);
// return ;
// }
$thread_id = Yii::app()->request->getParam("thread_id");
if (!isset($thread_id) || is_null($thread_id)) {
IjoyPlusServiceUtils::exportServiceError(Constants::PARAM_IS_INVALID);
return;
}
$comment = CacheManager::getCommentCache($thread_id);
if ($comment === null) {
IjoyPlusServiceUtils::exportEntity(array('comment' => array()));
} else {
$temp = IjoyPlusServiceUtils::transferComments($comment);
$comments = Comment::model()->getCommentReplies($thread_id, 10, 0);
$commentTemps = array();
if (isset($comments) && is_array($comments)) {
foreach ($comments as $comment) {
$commentTemps[] = IjoyPlusServiceUtils::transferComments($comment);
}
}
$temp->replies = $commentTemps;
IjoyPlusServiceUtils::exportEntity(array('comment' => $temp));
}
}
示例2: getCommentProgram
public static function getCommentProgram($thread_id)
{
$comment = CacheManager::getCommentCache($thread_id);
if (isset($comment) && !is_null($comment)) {
$prod = CacheManager::getProgramCache($comment->content_id);
if (isset($prod) && !is_null($prod)) {
return array('id' => $prod->d_id, 'name' => $prod->d_name, 'poster' => $prod->d_pic, 'type' => $prod->d_type);
}
}
return array('id' => '', 'name' => '', 'poster' => '', 'type' => '');
}