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


PHP ParseQuery::skip方法代码示例

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


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

示例1: process

 /**
  * @inheritdoc
  */
 public function process(array $settings = [])
 {
     $this->processOrders($settings);
     $this->processFilters($settings);
     $this->source->limit($settings['limit']);
     $this->source->skip(($settings['page'] - 1) * $settings['limit']);
     // run queries
     $gridData = new Grid\Data($this->source->find());
     // get all records to set grid total
     // @todo: cache result of total query for few minutes
     $this->source = new ParseQuery($this->collectionName);
     $this->processOrders($settings);
     $this->processFilters($settings);
     $gridData->setTotal(sizeof($this->source->limit(1000)->find()));
     return $gridData;
 }
开发者ID:bashmach,项目名称:bluz-skeleton-parse,代码行数:19,代码来源:ParseSource.php

示例2: indexAction

 /**
  * Lists all ProjectsAdmin entities.
  *
  * @Route("/index/{page}", name="admin_projects", defaults={ "page" = 1 })
  * @Method("GET")
  * @Template()
  */
 public function indexAction($page)
 {
     $query = new ParseQuery('Project');
     $query->ascending("label");
     $query->limit(12);
     $query->skip(12 * ($page - 1));
     $entities = $query->find();
     return array('entities' => $entities, 'hits' => ceil($query->count() / 12), 'page' => $page, 'csrf' => $this->get('form.csrf_provider'));
 }
开发者ID:leonardobarrientosc,项目名称:4046-PUCV-ICC-FICHAS-OBRAS-CIVILES,代码行数:16,代码来源:ProjectsAdminController.php

示例3: testEachFailsWithSkip

 public function testEachFailsWithSkip()
 {
     $total = 50;
     $count = 25;
     $this->saveObjects($total, function ($i) {
         $obj = new ParseObject("Object");
         $obj->set("x", $i + 1);
         return $obj;
     });
     $query = new ParseQuery("Object");
     $query->lessThanOrEqualTo("x", $count);
     $query->skip(5);
     $this->setExpectedException('\\Exception', 'skip');
     $query->each(function ($obj) {
     });
 }
开发者ID:rvdavid,项目名称:parse-php-sdk,代码行数:16,代码来源:ParseQueryTest.php

示例4: originated

 $originated = originated($user->getObjectId());
 $query = new ParseQuery("_User");
 $query->equalTo("objectId", $user->getObjectId());
 $user = $query->first();
 $query = new ParseQuery("NiceThing");
 $query->includeKey("refered_user");
 $query->descending("createdAt");
 $query->limit(3);
 $lastthreethings = $query->find();
 $new = 0;
 $inbox = 0;
 $query = new ParseQuery("_Session");
 $query->equalTo("user", $user);
 $query->includeKey("user");
 $query->descending("createdAt");
 $query->skip(1);
 $query->limit(1);
 $new = $query->find(true);
 if ($_SESSION['notification']) {
     $query = new ParseQuery("ChatLogs");
     $query->greaterThan('createdAt', date_format($new[0]->getCreatedAt(), 'Y-m-d\\TH:i:s.u\\Z'));
     $inbox = count($query->find());
     $query = new ParseQuery("NiceThing");
     $query->greaterThan('createdAt', $new[0]->getCreatedAt());
     $query->equalTo("refered_user", $user);
     $new = count($query->find());
     $_SESSION['notification'] = false;
 } else {
     $query = new ParseQuery("ChatLogs");
     $query->equalTo('reciever', $user->getObjectId());
     $query->greaterThan('createdAt', $_SESSION['last_date']);
开发者ID:louk,项目名称:One-Nice-Thing,代码行数:31,代码来源:index.php

示例5: first

 public function first($className, $equalToArray = array(), $ascending = null, $descending = null, $skip = null, $includeArray = array())
 {
     $query = new ParseQuery($className);
     if ($equalToArray) {
         foreach ($equalToArray as $key => $value) {
             $query->equalTo($key, $value);
         }
     }
     if ($ascending) {
         $query->ascending($ascending);
     }
     if ($descending) {
         $query->descending($descending);
     }
     if ($skip) {
         $query->skip($skip);
     }
     if ($includeArray) {
         foreach ($includeArray as $include) {
             $query->includeKey($include);
         }
     }
     return $query->first();
 }
开发者ID:alamops,项目名称:codeigniter-parse-library,代码行数:24,代码来源:parse.php

示例6: is_ajax

<?php

require '../init.php';
use Parse\ParseQuery;
// Function to check if the request is an AJAX request
function is_ajax()
{
    return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
}
if (is_ajax()) {
    $query = new ParseQuery("Episode");
    $query->descending("epId");
    $query->skip(FIRST_SHOWN_LIMIT);
    $heldeeps = $query->find();
    $count = count($heldeeps);
    $contents = [];
    for ($i = 0; $i < count($heldeeps); $i++) {
        $heldeep = $heldeeps[$i];
        $query = new ParseQuery("Track");
        $query->equalTo("episode", $heldeep);
        $tracks = $query->find();
        $content = "";
        for ($j = 0; $j < count($tracks); $j++) {
            $track = $tracks[$j];
            if ($special = $track->get("type")) {
                $content .= "<h4>{$special}</h4>";
            }
            $content .= "<li" . ($special ? " class='special'" : "") . ">" . $track->get("title");
            $content .= "<a target='_blank' href='https://soundcloud.com/search?q=" . urlencode($track->get("title")) . "'><i class='fa fa-search'></i></a>";
            $content .= "</li>";
        }
开发者ID:vincentbello,项目名称:heldeep,代码行数:31,代码来源:all_episodes.php


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