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


PHP Notice::limit方法代码示例

本文整理汇总了PHP中Notice::limit方法的典型用法代码示例。如果您正苦于以下问题:PHP Notice::limit方法的具体用法?PHP Notice::limit怎么用?PHP Notice::limit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Notice的用法示例。


在下文中一共展示了Notice::limit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getNoticeIds

 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->orderBy('created DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     $notice->whereAdd('is_local =' . Notice::REMOTE);
     // -1 == blacklisted, -2 == gateway (i.e. Twitter)
     $notice->whereAdd('is_local !=' . Notice::LOCAL_NONPUBLIC);
     $notice->whereAdd('is_local !=' . Notice::GATEWAY);
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     if (!empty($this->selectVerbs)) {
         $notice->whereAddIn('verb', $this->selectVerbs, $notice->columnType('verb'));
     }
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:29,代码来源:networkpublicnoticestream.php

示例2: getNoticeIds

 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->orderBy('created DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     if (common_config('public', 'localonly')) {
         $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
     } else {
         // -1 == blacklisted, -2 == gateway (i.e. Twitter)
         $notice->whereAdd('is_local !=' . Notice::LOCAL_NONPUBLIC);
         $notice->whereAdd('is_local !=' . Notice::GATEWAY);
     }
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:29,代码来源:publicnoticestream.php

示例3: prepare

 /**
  * For initializing members of the class.
  *
  * @param array $argarray misc. arguments
  *
  * @return boolean true
  */
 function prepare($argarray)
 {
     parent::prepare($argarray);
     $convId = $this->trimmed('id');
     if (empty($convId)) {
         // TRANS: Client exception thrown when no conversation ID is given.
         throw new ClientException(_('No conversation ID.'));
     }
     $this->conversation = Conversation::staticGet('id', $convId);
     if (empty($this->conversation)) {
         // TRANS: Client exception thrown when referring to a non-existing conversation ID (%d).
         $this->clientError(_('No conversation ID found'), 404);
         return false;
     }
     $profile = Profile::current();
     $stream = new ConversationNoticeStream($convId, $profile);
     $notice = $stream->getNotices(($this->page - 1) * $this->count, $this->count, $this->since_id, $this->max_id);
     $this->notices = $notice->fetchAll();
     $originalConversation = new Notice();
     $originalConversation->whereAdd('conversation=' . $convId);
     $originalConversation->limit(1);
     $originalConversation->orderBy('created');
     $originalConversation->find();
     if ($originalConversation->fetch()) {
         $this->originalNotice = $originalConversation;
     }
     return true;
 }
开发者ID:jianoll,项目名称:SpeakEnglish_Server,代码行数:35,代码来源:apiconversation.php

示例4: getNoticeIds

 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->orderBy('created DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     // This feed always gives only local activities.
     $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     if (!empty($this->selectVerbs)) {
         $notice->whereAddIn('verb', $this->selectVerbs, $notice->columnType('verb'));
     }
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:27,代码来源:publicnoticestream.php

示例5: getNoticeIds

 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->orderBy('created DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     if (common_config('public', 'localonly')) {
         $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
     } else {
         // -1 == blacklisted, -2 == gateway (i.e. Twitter)
         $notice->whereAdd('is_local !=' . Notice::LOCAL_NONPUBLIC);
         $notice->whereAdd('is_local !=' . Notice::GATEWAY);
     }
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     $strSql = sprintf('(content_type=%d or content_type=%d)', NOTICE::CONTENT_TYPE_POST, NOTICE::CONTENT_TYPE_REPEAT);
     $strSql = sprintf('(content_type in (%d,%d,%d,%d))', NOTICE::CONTENT_TYPE_REPEAT, NOTICE::CONTENT_TYPE_REPEAT | NOTICE::CONTENT_TYPE_MENTIONS, NOTICE::CONTENT_TYPE_POST, NOTICE::CONTENT_TYPE_POST | NOTICE::CONTENT_TYPE_MENTIONS);
     $notice->whereAdd($strSql);
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
开发者ID:jianoll,项目名称:SpeakEnglish_Server,代码行数:32,代码来源:publicnoticestream.php

示例6: getNextBatch

 /**
  * Fetch the next self::DELETION_WINDOW messages for this user.
  * @return Notice
  */
 protected function getNextBatch(User $user)
 {
     $notice = new Notice();
     $notice->profile_id = $user->id;
     $notice->limit(self::DELETION_WINDOW);
     $notice->find();
     return $notice;
 }
开发者ID:phpsource,项目名称:gnu-social,代码行数:12,代码来源:deluserqueuehandler.php

示例7: getNoticeIds

 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->conversation = $this->id;
     $notice->orderBy('created DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     return $ids;
 }
开发者ID:harriewang,项目名称:InnertieWebsite,代码行数:21,代码来源:conversationnoticestream.php

示例8: getNoticeIds

 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     $notice->selectAdd('id');
     $notice->orderBy('id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     $notice->whereAdd('is_local !=' . Notice::LOCAL_NONPUBLIC);
     $notice->whereAdd('is_local !=' . Notice::GATEWAY);
     $notice->whereAdd('repeat_of IS NULL');
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
开发者ID:bashrc,项目名称:gnusocial-qvitter-debian,代码行数:24,代码来源:PublicAndExternalNoticeStream.php

示例9: getNoticeIds

 function getNoticeIds($offset, $limit, $since_id = null, $max_id = null)
 {
     $notice = new Notice();
     // SELECT
     $notice->selectAdd();
     $notice->selectAdd('id');
     // WHERE
     $notice->conversation = $this->id;
     if (!empty($since_id)) {
         $notice->whereAdd(sprintf('notice.id > %d', $since_id));
     }
     if (!empty($max_id)) {
         $notice->whereAdd(sprintf('notice.id <= %d', $max_id));
     }
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     if (!empty($this->selectVerbs)) {
         $notice->whereAddIn('verb', $this->selectVerbs, $notice->columnType('verb'));
     }
     // ORDER BY
     // currently imitates the previously used "_reverseChron" sorting
     $notice->orderBy('notice.created DESC');
     $notice->find();
     return $notice->fetchAll('id');
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:26,代码来源:conversationnoticestream.php

示例10: checkDupe

 /**
  * Check to see if this Twitter status has already been imported
  *
  * @param Profile $profile   Twitter user's local profile
  * @param string  $statusUri URI of the status on Twitter
  *
  * @return mixed value a matching Notice or null
  */
 function checkDupe($profile, $statusUri)
 {
     $notice = new Notice();
     $notice->uri = $statusUri;
     $notice->profile_id = $profile->id;
     $notice->limit(1);
     if ($notice->find()) {
         $notice->fetch();
         return $notice;
     }
     return null;
 }
开发者ID:harriewang,项目名称:InnertieWebsite,代码行数:20,代码来源:twitterimport.php

示例11: Notice

 function _repeatStreamDirect($limit)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->repeat_of = $this->id;
     $notice->orderBy('created, id');
     // NB: asc!
     if (!is_null($limit)) {
         $notice->limit(0, $limit);
     }
     return $notice->fetchAll('id');
 }
开发者ID:a780201,项目名称:gnu-social,代码行数:14,代码来源:Notice.php

示例12: handle

 /**
  * Handle the request
  *
  * Check the format and show the user info
  *
  * @param array $args $_REQUEST data (unused)
  *
  * @return void
  */
 protected function handle()
 {
     parent::handle();
     // favs
     $fave = new Fave();
     $fave->selectAdd();
     $fave->selectAdd('user_id');
     $fave->selectAdd('modified');
     $fave->notice_id = $this->original->id;
     $fave->orderBy('modified');
     if (!is_null($this->cnt)) {
         $fave->limit(0, $this->cnt);
     }
     $fav_ids = $fave->fetchAll('user_id', 'modified');
     // get nickname and profile image
     $fav_ids_with_profile_data = array();
     $i = 0;
     foreach ($fav_ids as $id => $time) {
         $profile = Profile::getKV('id', $id);
         $fav_ids_with_profile_data[$i]['user_id'] = $id;
         $fav_ids_with_profile_data[$i]['nickname'] = $profile->nickname;
         $fav_ids_with_profile_data[$i]['fullname'] = $profile->fullname;
         $fav_ids_with_profile_data[$i]['profileurl'] = $profile->profileurl;
         $fav_ids_with_profile_data[$i]['time'] = strtotime($time);
         $profile = new Profile();
         $profile->id = $id;
         $avatarurl = $profile->avatarUrl(48);
         $fav_ids_with_profile_data[$i]['avatarurl'] = $avatarurl;
         $i++;
     }
     // repeats
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('profile_id');
     $notice->selectAdd('created');
     $notice->repeat_of = $this->original->id;
     $notice->orderBy('created, id');
     // NB: asc!
     if (!is_null($this->cnt)) {
         $notice->limit(0, $this->cnt);
     }
     $repeat_ids = $notice->fetchAll('profile_id', 'created');
     // get nickname and profile image
     $repeat_ids_with_profile_data = array();
     $i = 0;
     foreach ($repeat_ids as $id => $time) {
         $profile = Profile::getKV('id', $id);
         $repeat_ids_with_profile_data[$i]['user_id'] = $id;
         $repeat_ids_with_profile_data[$i]['nickname'] = $profile->nickname;
         $repeat_ids_with_profile_data[$i]['fullname'] = $profile->fullname;
         $repeat_ids_with_profile_data[$i]['profileurl'] = $profile->profileurl;
         $repeat_ids_with_profile_data[$i]['time'] = strtotime($time);
         $profile = new Profile();
         $profile->id = $id;
         $avatarurl = $profile->avatarUrl(48);
         $repeat_ids_with_profile_data[$i]['avatarurl'] = $avatarurl;
         $i++;
     }
     $favs_and_repeats = array('favs' => $fav_ids_with_profile_data, 'repeats' => $repeat_ids_with_profile_data);
     $this->initDocument('json');
     $this->showJsonObjects($favs_and_repeats);
     $this->endDocument('json');
 }
开发者ID:singpolyma,项目名称:qvitter,代码行数:73,代码来源:apifavsandrepeats.php

示例13: Notice

 function _repeatedByMeDirect($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->profile_id = $this->id;
     $notice->whereAdd('repeat_of IS NOT NULL');
     $notice->orderBy('id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     if ($since_id != 0) {
         $notice->whereAdd('id > ' . $since_id);
     }
     if ($max_id != 0) {
         $notice->whereAdd('id <= ' . $max_id);
     }
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
开发者ID:stevertiqo,项目名称:StatusNet,代码行数:28,代码来源:User.php

示例14: getCurrentNotice

 function getCurrentNotice($dt = null)
 {
     $notice = new Notice();
     $notice->profile_id = $this->id;
     if ($dt) {
         $notice->whereAdd('created < "' . $dt . '"');
     }
     $notice->orderBy('created DESC, notice.id DESC');
     $notice->limit(1);
     if ($notice->find(true)) {
         return $notice;
     }
     return null;
 }
开发者ID:Br3nda,项目名称:laconica,代码行数:14,代码来源:Profile.php

示例15: getNoticeIds

 /**
  * Query notices by users associated with this tag from the database.
  *
  * @param integer $offset   offset
  * @param integer $limit    maximum no of results
  * @param integer $since_id=null    since this id
  * @param integer $max_id=null  maximum id in result
  *
  * @return array array of notice ids.
  */
 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     $notice->selectAdd('notice.id');
     $ptag = new Profile_tag();
     $ptag->tag = $this->profile_list->tag;
     $ptag->tagger = $this->profile_list->tagger;
     $notice->joinAdd(array('profile_id', 'profile_tag:tagged'));
     $notice->whereAdd('profile_tag.tagger = ' . $this->profile_list->tagger);
     $notice->whereAdd(sprintf('profile_tag.tag = "%s"', $this->profile_list->tag));
     if ($since_id != 0) {
         $notice->whereAdd('notice.id > ' . $since_id);
     }
     if ($max_id != 0) {
         $notice->whereAdd('notice.id <= ' . $max_id);
     }
     $notice->orderBy('notice.id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     return $ids;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:39,代码来源:peopletagnoticestream.php


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