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


PHP Notice::multiGet方法代码示例

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


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

示例1: getNotices

 function getNotices($offset, $limit, $ids)
 {
     if (empty($ids)) {
         $this->error = "El usuario " . $this->alumno->nickname . " no ha publicado nada en " . $this->group->nickname;
         return;
     }
     $total = $offset + $limit;
     for ($i = $offset; $i < $total; $i++) {
         $idsFinal[] = $ids[$i];
     }
     $notices = Notice::multiGet('id', $idsFinal);
     return $notices;
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:13,代码来源:GradeshowuserAction.php

示例2: getNotices

 function getNotices()
 {
     $notices = array();
     $stream = new CommentByUserNoticeStream($userId);
     $notice = $stream->getNotices(($this->page - 1) * $this->count, $this->count, $this->since_id, $this->max_id);
     while ($notice->fetch()) {
         $notices[] = clone $notice;
     }
     $replyNoticeIds = array();
     foreach ($notices as $notice) {
         $reply_toId = $notice->reply_to;
         if (!empty($reply_toId)) {
             $replyNoticeIds[] = $notice->reply_to;
         }
     }
     $replyNotice = Notice::multiGet('id', $replyNoticeIds);
     while ($replyNotice->fetch()) {
         $replyNoticeArray[] = clone $replyNotice;
     }
     $this->m_notices = new ArrayWrapper($notices);
     $this->m_replyNotices = new ArrayWrapper($replyNoticeArray);
 }
开发者ID:jianoll,项目名称:SpeakEnglish_Server,代码行数:22,代码来源:apicommentsbyme.php

示例3: exit

    print "You must provide a file ID.\n";
    exit(1);
}
$verbose = have_option('v', 'verbose');
if (!have_option('y', 'yes')) {
    try {
        $filename = $file->getFilename();
    } catch (Exception $e) {
        $filename = '(remote file or no filename)';
    }
    print "About to PERMANENTLY delete file ({$filename}) with id=={$file->id}) AND its related notices. Are you sure? [y/N] ";
    $response = fgets(STDIN);
    if (strtolower(trim($response)) != 'y') {
        print "Aborting.\n";
        exit(0);
    }
}
print "Finding notices...\n";
try {
    $ids = File_to_post::getNoticeIDsByFile($file);
    $notice = Notice::multiGet('id', $ids);
    while ($notice->fetch()) {
        print "Deleting notice {$notice->id}" . ($verbose ? ": {$notice->content}\n" : "\n");
        $notice->delete();
    }
} catch (NoResultException $e) {
    print "No notices found with this File attached.\n";
}
print "Deleting File object together with possibly locally stored copy.\n";
$file->delete();
print "DONE.\n";
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:31,代码来源:nukefile.php

示例4: showContent

 function showContent()
 {
     $this->elementStart('div', 'qna-full-question');
     $this->raw($this->question->asHTML());
     $answer = $this->question->getAnswers();
     $this->elementStart('div', 'qna-full-question-answers');
     $answerIds = array();
     // @fixme use a filtered stream!
     if (!empty($answer)) {
         while ($answer->fetch()) {
             $answerIds[] = $answer->getNotice()->id;
         }
     }
     if (count($answerIds) > 0) {
         $notice = Notice::multiGet('id', $answerIds);
         $nli = new NoticeList($notice, $this);
         $nli->show();
     }
     $user = common_current_user();
     if (!empty($user)) {
         $profile = $user->getProfile();
         $answer = QnA_Question::getAnswer($profile);
         if (empty($answer)) {
             $form = new QnanewanswerForm($this, $this->question, false);
             $form->show();
         }
     }
     $this->elementEnd('div');
     $this->elementEnd('div');
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:30,代码来源:qnashowquestion.php

示例5: getStreamByIds

 static function getStreamByIds($ids)
 {
     return Notice::multiGet('id', $ids);
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:4,代码来源:noticestream.php

示例6: getNotices

 /**
  * Get notices
  *
  * @return array notices
  */
 function getNotices()
 {
     $notices = array();
     if (empty($this->auth_user)) {
         $profile = null;
     } else {
         $profile = $this->auth_user->getProfile();
     }
     $stream = new ReplyNoticeStream($this->user->id, $profile);
     $notice = $stream->getNotices(($this->page - 1) * $this->count, $this->count, $this->since_id, $this->max_id);
     while ($notice->fetch()) {
         $notices[] = clone $notice;
     }
     if ($this->include_in_reply_to_status) {
         $replyNoticeIds = array();
         foreach ($notices as $notice) {
             $reply_toId = $notice->reply_to;
             if (!empty($reply_toId)) {
                 $replyNoticeIds[] = $notice->reply_to;
             }
         }
         $replyNotice = Notice::multiGet('id', $replyNoticeIds);
         while ($replyNotice->fetch()) {
             $replyNoticeArray[] = clone $replyNotice;
         }
         $this->replyNotices = new ArrayWrapper($replyNoticeArray);
     }
     return $notices;
 }
开发者ID:jianoll,项目名称:SpeakEnglish_Server,代码行数:34,代码来源:apitimelinementions.php

示例7: showJsonTimeline

 function showJsonTimeline($notice)
 {
     $this->initDocument('json');
     $statuses = array();
     if (is_array($notice)) {
         //FIXME: make everything calling showJsonTimeline use only Notice objects
         $ids = array();
         foreach ($notice as $n) {
             $ids[] = $n->getID();
         }
         $notice = Notice::multiGet('id', $ids);
     }
     while ($notice->fetch()) {
         try {
             $twitter_status = $this->twitterStatusArray($notice);
             array_push($statuses, $twitter_status);
         } catch (Exception $e) {
             common_log(LOG_ERR, $e->getMessage());
             continue;
         }
     }
     $this->showJsonObjects($statuses);
     $this->endDocument('json');
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:24,代码来源:apiaction.php

示例8: handle

 /**
  * Class handler.
  *
  * @param array $args query arguments
  *
  * @return void
  */
 function handle($args)
 {
     parent::handle($args);
     if (!common_logged_in()) {
         $this->clientError(_('Not logged in.'));
         return;
     }
     $user = common_current_user();
     if ($_SERVER['REQUEST_METHOD'] != 'POST') {
         common_redirect(common_local_url('all', array('nickname' => $user->nickname)));
         return;
     }
     $idGroup = $this->trimmed('idGroup');
     $token = $this->trimmed('token-' . $idGroup);
     if (!$token || $token != common_session_token()) {
         $this->clientError(_('There was a problem with your session token. Try again, please.'));
         return;
     }
     if ($this->trimmed('submit-auto') != null) {
         $groupids = NotesPDF::getNoticeIDsInAGroupModeAuto($idGroup);
         $notices = Notice::multiGet('id', $groupids)->fetchAll();
         GenerarPDF::content($idGroup, $notices, 'Automáticos');
     } else {
         if ($this->trimmed('submit-custom') != null) {
             $tag = $this->trimmed('combo-tag') == 'Todos' ? '%' : $this->trimmed('combo-tag');
             $nick = $this->trimmed('combo-user') == 'Todos' ? '%' : $this->trimmed('combo-user');
             $grade = $this->trimmed('combo-grade') == 'Todos' ? '%' : $this->trimmed('combo-grade');
             $noticeIds = NotesPDF::getNoticesInModeCustom(array('idGroup' => $idGroup, 'tag' => $tag, 'nick' => $nick, 'grade' => $grade));
             $notices = Notice::multiGet('id', $noticeIds)->fetchAll();
             GenerarPDF::content($idGroup, $notices, 'Personalizados');
         } else {
             $this->showForm('Error al generar los apuntes. Inténtelo de nuevo en unos minutos.');
         }
     }
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:42,代码来源:NotesgenerateAction.php


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