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


PHP Notice::free方法代码示例

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


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

示例1: getNoticeIds

 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $qry = null;
     $qry = 'SELECT notice.* FROM notice ';
     $qry .= 'INNER JOIN happening ON happening.uri = notice.uri ';
     $qry .= 'AND notice.is_local != ' . Notice::GATEWAY . ' ';
     if ($since_id != 0) {
         $qry .= 'AND notice.id > ' . $since_id . ' ';
     }
     if ($max_id != 0) {
         $qry .= 'AND notice.id <= ' . $max_id . ' ';
     }
     // NOTE: we sort by event time, not by notice time!
     $qry .= 'ORDER BY happening.created DESC ';
     if (!is_null($offset)) {
         $qry .= "LIMIT {$limit} OFFSET {$offset}";
     }
     $notice->query($qry);
     $ids = array();
     while ($notice->fetch()) {
         $ids[] = $notice->id;
     }
     $notice->free();
     unset($notice);
     return $ids;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:27,代码来源:eventsnoticestream.php

示例2: conversationRoot

 /**
  * Grab the earliest notice from this conversation.
  *
  * @return Notice or null
  */
 function conversationRoot($profile = -1)
 {
     // XXX: can this happen?
     if (empty($this->conversation)) {
         return null;
     }
     // Get the current profile if not specified
     if (is_int($profile) && $profile == -1) {
         $profile = Profile::current();
     }
     // If this notice is out of scope, no root for you!
     if (!$this->inScope($profile)) {
         return null;
     }
     // If this isn't a reply to anything, then it's its own
     // root if it's the earliest notice in the conversation:
     if (empty($this->reply_to)) {
         $root = new Notice();
         $root->conversation = $this->conversation;
         $root->orderBy('notice.created ASC');
         $root->find(true);
         // true means "fetch first result"
         $root->free();
         return $root;
     }
     if (is_null($profile)) {
         $keypart = sprintf('notice:conversation_root:%d:null', $this->id);
     } else {
         $keypart = sprintf('notice:conversation_root:%d:%d', $this->id, $profile->id);
     }
     $root = self::cacheGet($keypart);
     if ($root !== false && $root->inScope($profile)) {
         return $root;
     }
     $last = $this;
     while (true) {
         try {
             $parent = $last->getParent();
             if ($parent->inScope($profile)) {
                 $last = $parent;
                 continue;
             }
         } catch (NoParentNoticeException $e) {
             // Latest notice has no parent
         } catch (NoResultException $e) {
             // Notice was not found, so we can't go further up in the tree.
             // FIXME: Maybe we should do this in a more stable way where deleted
             // notices won't break conversation chains?
         }
         // No parent, or parent out of scope
         $root = $last;
         break;
     }
     self::cacheSet($keypart, $root);
     return $root;
 }
开发者ID:a780201,项目名称:gnu-social,代码行数:61,代码来源:Notice.php

示例3: array

 function _repeatsOfMeDirect($offset, $limit, $since_id, $max_id)
 {
     $qry = 'SELECT DISTINCT original.id AS id ' . 'FROM notice original JOIN notice rept ON original.id = rept.repeat_of ' . 'WHERE original.profile_id = ' . $this->id . ' ';
     if ($since_id != 0) {
         $qry .= 'AND original.id > ' . $since_id . ' ';
     }
     if ($max_id != 0) {
         $qry .= 'AND original.id <= ' . $max_id . ' ';
     }
     // NOTE: we sort by fave time, not by notice time!
     $qry .= 'ORDER BY original.id DESC ';
     if (!is_null($offset)) {
         $qry .= "LIMIT {$limit} OFFSET {$offset}";
     }
     $ids = array();
     $notice = new Notice();
     $notice->query($qry);
     while ($notice->fetch()) {
         $ids[] = $notice->id;
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
开发者ID:stevertiqo,项目名称:StatusNet,代码行数:24,代码来源:User.php

示例4: Notice

 function _repeatStreamDirect($limit)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->repeat_of = $this->id;
     $notice->orderBy('created');
     // NB: asc!
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
开发者ID:Br3nda,项目名称:statusnet-debian,代码行数:22,代码来源:Notice.php

示例5: conversationRoot

 /**
  * Grab the earliest notice from this conversation.
  *
  * @return Notice or null
  */
 function conversationRoot($profile = -1)
 {
     // XXX: can this happen?
     if (empty($this->conversation)) {
         return null;
     }
     // Get the current profile if not specified
     if (is_int($profile) && $profile == -1) {
         $profile = Profile::current();
     }
     // If this notice is out of scope, no root for you!
     if (!$this->inScope($profile)) {
         return null;
     }
     // If this isn't a reply to anything, then it's its own
     // root if it's the earliest notice in the conversation:
     if (empty($this->reply_to)) {
         $root = new Notice();
         $root->conversation = $this->conversation;
         $root->orderBy('notice.created ASC');
         $root->find();
         $root->fetch();
         $root->free();
         return $root;
     }
     if (is_null($profile)) {
         $keypart = sprintf('notice:conversation_root:%d:null', $this->id);
     } else {
         $keypart = sprintf('notice:conversation_root:%d:%d', $this->id, $profile->id);
     }
     $root = self::cacheGet($keypart);
     if ($root !== false && $root->inScope($profile)) {
         return $root;
     }
     $last = $this;
     while (true) {
         try {
             $parent = $last->getParent();
             if ($parent->inScope($profile)) {
                 $last = $parent;
                 continue;
             }
         } catch (NoParentNoticeException $e) {
             // Latest notice has no parent
         }
         // No parent, or parent out of scope
         $root = $last;
         break;
     }
     self::cacheSet($keypart, $root);
     return $root;
 }
开发者ID:phpsource,项目名称:gnu-social,代码行数:57,代码来源:Notice.php

示例6: array

 function _repeatsOfMeDirect($offset, $limit, $since_id, $max_id)
 {
     $qry = 'SELECT DISTINCT original.id AS id ' . 'FROM notice original JOIN notice rept ON original.id = rept.repeat_of ' . 'WHERE original.profile_id = ' . $this->id . ' ';
     $since = Notice::whereSinceId($since_id, 'original.id', 'original.created');
     if ($since) {
         $qry .= "AND ({$since}) ";
     }
     $max = Notice::whereMaxId($max_id, 'original.id', 'original.created');
     if ($max) {
         $qry .= "AND ({$max}) ";
     }
     $qry .= 'ORDER BY original.created, original.id DESC ';
     if (!is_null($offset)) {
         $qry .= "LIMIT {$limit} OFFSET {$offset}";
     }
     $ids = array();
     $notice = new Notice();
     $notice->query($qry);
     while ($notice->fetch()) {
         $ids[] = $notice->id;
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:25,代码来源:User.php


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