当前位置: 首页>>代码示例>>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;未经允许,请勿转载。