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


PHP Notice::joinAdd方法代码示例

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


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

示例1: getNotices

 function getNotices()
 {
     $notice = new Notice();
     $notice->joinAdd(array('id', 'file_to_post:post_id'));
     $notice->whereAdd(sprintf('file_to_post.file_id = %d', $this->out->attachment->id));
     $notice->orderBy('created desc');
     $notice->selectAdd('post_id as id');
     $notice->find();
     return $notice;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:10,代码来源:attachmentnoticesection.php

示例2: getNotices

 function getNotices()
 {
     $notice = new Notice();
     $f2p = new File_to_post();
     $f2p->file_id = $this->out->attachment->id;
     $notice->joinAdd($f2p);
     $notice->orderBy('created desc');
     $notice->selectAdd('post_id as id');
     $notice->find();
     return $notice;
 }
开发者ID:himmelex,项目名称:NTW,代码行数:11,代码来源:attachmentnoticesection.php

示例3: initInbox

function initInbox()
{
    printfnq("Ensuring all users have an inbox...");
    $user = new User();
    $user->whereAdd('not exists (select user_id from inbox where user_id = user.id)');
    $user->orderBy('id');
    if ($user->find()) {
        while ($user->fetch()) {
            try {
                $notice = new Notice();
                $notice->selectAdd();
                $notice->selectAdd('id');
                $notice->joinAdd(array('profile_id', 'subscription:subscribed'));
                $notice->whereAdd('subscription.subscriber = ' . $user->id);
                $notice->whereAdd('notice.created >= subscription.created');
                $ids = array();
                if ($notice->find()) {
                    while ($notice->fetch()) {
                        $ids[] = $notice->id;
                    }
                }
                $notice = null;
                $inbox = new Inbox();
                $inbox->user_id = $user->id;
                $inbox->pack($ids);
                $inbox->insert();
            } catch (Exception $e) {
                printv("Error initializing inbox: " . $e->getMessage());
            }
        }
    }
    printfnq("DONE.\n");
}
开发者ID:Grasia,项目名称:bolotweet,代码行数:33,代码来源:upgrade.php

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