当前位置: 首页>>代码示例>>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;未经允许,请勿转载。