本文整理汇总了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;
}
示例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;
}
示例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");
}
示例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;
}