本文整理汇总了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;
}
示例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);
}
示例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";
示例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');
}
示例5: getStreamByIds
static function getStreamByIds($ids)
{
return Notice::multiGet('id', $ids);
}
示例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;
}
示例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');
}
示例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.');
}
}
}