當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Comments::count方法代碼示例

本文整理匯總了PHP中Comments::count方法的典型用法代碼示例。如果您正苦於以下問題:PHP Comments::count方法的具體用法?PHP Comments::count怎麽用?PHP Comments::count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Comments的用法示例。


在下文中一共展示了Comments::count方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: templateData

 public function templateData()
 {
     $uAuthor = ObjectCache::getByType('\\Kiki\\User', $this->userId);
     $data = array('id' => $this->id, 'url' => $this->url(), 'ctime' => strtotime($this->ctime), 'relTime' => Misc::relativeTime($this->ctime), 'title' => $this->title(), 'body' => $this->body, 'author' => $uAuthor->name(), 'publications' => array(), 'likes' => $this->likes(), 'comments' => Comments::count($this->objectId), 'html' => array('comments' => Comments::show($this->objectId)));
     $publications = $this->publications();
     foreach ($publications as $publication) {
         $data['publications'][] = $publication->templateData();
     }
     return $data;
 }
開發者ID:robkaper,項目名稱:kiki,代碼行數:10,代碼來源:socialupdate.php

示例2: templateData

 public function templateData()
 {
     $uAuthor = ObjectCache::getByType('\\Kiki\\User', $this->userId);
     $prevArticle = $this->getPrev();
     $nextArticle = $this->getNext();
     $data = array('id' => $this->id, 'url' => $this->url(), 'ctime' => strtotime($this->ctime), 'relTime' => Misc::relativeTime($this->ctime), 'title' => $this->title, 'body' => $this->body, 'author' => $uAuthor->name(), 'images' => array(), 'publications' => array(), 'likes' => $this->likes(), 'comments' => Comments::count($this->objectId), 'html' => array('comments' => Comments::show($this->objectId), 'editform' => $this->form(true, 'articles')));
     if ($nextArticle = $this->getNext()) {
         $data['next'] = array('id' => $nextArticle->id(), 'url' => $nextArticle->url(), 'title' => $nextArticle->title());
     }
     if ($prevArticle = $this->getPrev()) {
         $data['prev'] = array('id' => $prevArticle->id(), 'url' => $prevArticle->url(), 'title' => $prevArticle->title());
     }
     $publications = $this->publications();
     foreach ($publications as $publication) {
         $data['publications'][] = $publication->templateData();
     }
     $images = $this->images();
     foreach ($images as $image) {
         $data['images'][] = Storage::url($image);
     }
     // print_r( $data['images'] );
     return $data;
 }
開發者ID:robkaper,項目名稱:kiki,代碼行數:23,代碼來源:article.php

示例3: getStatistics

 public function getStatistics()
 {
     return ['comments' => Comments::count('user_id = "' . $this->id . '"'), 'tags' => Taggables::count('user_id = "' . $this->id . '"'), 'links' => Links::count('user_id = "' . $this->id . '"'), 'favorites' => Favorites::count('user_id = "' . $this->id . '"')];
 }
開發者ID:huoybb,項目名稱:movie,代碼行數:4,代碼來源:Users.php


注:本文中的Comments::count方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。