當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ParseQuery::addDescending方法代碼示例

本文整理匯總了PHP中Parse\ParseQuery::addDescending方法的典型用法代碼示例。如果您正苦於以下問題:PHP ParseQuery::addDescending方法的具體用法?PHP ParseQuery::addDescending怎麽用?PHP ParseQuery::addDescending使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Parse\ParseQuery的用法示例。


在下文中一共展示了ParseQuery::addDescending方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: processOrders

 /**
  * Apply order settings to the source
  *
  * @param array $settings
  */
 protected function processOrders(array $settings = [])
 {
     foreach ($settings['orders'] as $column => $order) {
         switch ($order) {
             case Grid\Grid::ORDER_ASC:
                 $this->source->addAscending($column);
                 break;
             case Grid\Grid::ORDER_DESC:
                 $this->source->addDescending($column);
                 break;
             default:
                 break;
         }
     }
 }
開發者ID:bashmach,項目名稱:bluz-skeleton-parse,代碼行數:20,代碼來源:ParseSource.php

示例2: showNotifications

 public function showNotifications(Request $request)
 {
     $current_user = ParseUser::getCurrentUser();
     $query = new ParseQuery("Notifications");
     $query->equalTo("for", $current_user);
     $query->equalTo("read", false);
     $query->includeKey('by');
     $query->includeKey('message');
     $query->addDescending('createdAt');
     try {
         $notifications = $query->find();
         Html\Assets::addLink(Html\Link::Css(elixir('css/default.css')));
         $renderData = $this->getRenderData($request);
         $notes = array();
         foreach ($notifications as $notify) {
             if (!empty($notify->get('message'))) {
                 $byimage = $notify->get('by')->get('image');
                 $chatroom = $notify->get('message')->get('chatRoom');
                 $relation = $notify->get('message')->getRelation('asset');
                 $assets = $relation->getQuery()->find();
                 if (empty($chatroom)) {
                     continue;
                 }
                 $chatroom->fetch();
                 $notes[] = ['notification' => $notify, 'byimage' => $byimage, 'chatRoom' => $chatroom, 'assets' => $assets];
             }
             $notify->set("read", true);
             $notify->save();
         }
         $renderData['user'] = $current_user;
         $renderData['notifications'] = $notes;
         return view('notification', $renderData);
     } catch (\Exception $ex) {
         echo $ex->getMessage();
         die;
     }
 }
開發者ID:samphomsopha,項目名稱:codelab,代碼行數:37,代碼來源:HomeController.php


注:本文中的Parse\ParseQuery::addDescending方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。