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


PHP Builder::offset方法代碼示例

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


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

示例1: applyOffset

 /**
  * @param $value
  * @return $this
  */
 public function applyOffset($value)
 {
     /**
      * Save to conditons.
      */
     $this->addCondition('offset', $value);
     $this->model = $this->model->offset($value);
     return $this;
 }
開發者ID:aaronjan,項目名稱:housekeeper,代碼行數:13,代碼來源:Plan.php

示例2: parse

 /**
  * Parse the query parameters with the given options.
  * Either for a single dataset or multiple.
  *
  * @param  mixed    $options
  * @param  boolean  $multiple
  * @return void
  */
 public function parse($options, $multiple = false)
 {
     $this->multiple = $multiple;
     if ($multiple) {
         $fullTextSearchColumns = $options;
         //Parse and apply offset using the laravel "offset" function
         if ($offset = $this->getParam('offset')) {
             $offset = intval($offset);
             $this->query->offset($offset);
         }
         //Parse and apply limit using the laravel "limit" function
         if ($limit = $this->getParam('limit')) {
             $limit = intval($limit);
             $this->query->limit($limit);
         }
         //Parse and apply the filters using the different laravel "where" functions
         //Every parameter that has not a predefined functionality gets parsed as a filter
         if ($filterParams = $this->getFilterParams()) {
             $this->parseFilter($filterParams);
         }
         //Parse an apply the fulltext search using the different laravel "where" functions
         //The fulltext search is only applied to the columns passed by $fullTextSearchColumns.
         if ($this->getParam('q') !== false) {
             $this->parseFulltextSearch($this->getParam('q'), $fullTextSearchColumns);
         }
     } else {
         $identification = $options;
         if (is_numeric($identification)) {
             $this->query->where('id', $identification);
         } else {
             if (is_array($identification)) {
                 foreach ($identification as $column => $value) {
                     $this->query->where($column, $value);
                 }
             }
         }
     }
     //Parse and apply field elements using the laravel "select" function
     //The needed fields for the with function (Primary and foreign keys) have to be added accordingly
     if ($fields = $this->getParam('fields')) {
         $this->parseFields($fields);
     }
     //Parse and apply sort elements using the laravel "orderBy" function
     if ($sort = $this->getParam('sort')) {
         $this->parseSort($sort);
     }
     //Parse and apply with elements using the Laravel "with" function
     if (($with = $this->getParam('with')) && $this->isEloquentBuilder) {
         $this->parseWith($with);
     }
     //Parse the config params
     if ($config = $this->getParam('config')) {
         $this->parseConfig($config);
     }
     if ($this->isEloquentBuilder) {
         //Attach the query builder object back to the eloquent builder object
         $this->builder->setQuery($this->query);
     }
 }
開發者ID:marcelgwerder,項目名稱:laravel-api-handler,代碼行數:67,代碼來源:Parser.php

示例3: offset

 /**
  * Set the "offset" value of the query.
  *
  * @param int $value
  * @return $this 
  * @static 
  */
 public static function offset($value)
 {
     return \Illuminate\Database\Query\Builder::offset($value);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:11,代碼來源:_ide_helper.php


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