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


PHP Builder::limit方法代码示例

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


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

示例1: applyLimit

 /**
  * @param $value
  * @return $this
  */
 public function applyLimit($value)
 {
     /**
      * Save to conditons.
      */
     $this->addCondition('limit', $value);
     $this->model = $this->model->limit($value);
     return $this;
 }
开发者ID:aaronjan,项目名称:housekeeper,代码行数:13,代码来源:Plan.php

示例2: pagination

 /**
  * Возвращает коллекцию в виде пагинации
  *
  * @param int $page
  * @param int $limit
  */
 public function pagination($page, $limit = 10)
 {
     /**
      * @var \Illuminate\Support\Collection $data
      */
     $countTotal = $this->_query->count();
     $this->_query->skip($limit * $page - $limit);
     $this->_query->limit($limit);
     $data = collect();
     foreach ($this->_query->get() as $key => $instance) {
         $_listRow = [];
         foreach ($this->columns->getColumns() as $column) {
             $_listRow[$column->getKey()] = $column->getValues($instance);
         }
         $buttons = $this->filterAction($instance);
         if (count($buttons)) {
             $_listRow = array_merge($_listRow, [GridColumn::ACTION_NAME => implode('', $buttons)]);
         }
         $data->offsetSet($key, $_listRow);
     }
     return new \Illuminate\Pagination\LengthAwarePaginator($data, $countTotal, $limit, $page, ['path' => \Illuminate\Pagination\Paginator::resolveCurrentPath(), 'pageName' => 'page']);
 }
开发者ID:assurrussa,项目名称:grid-view-vue,代码行数:28,代码来源:GridView.php

示例3: scopeRecentlyCreated

 /**
  * Recently created scope
  *
  * @param Builder $query
  * @param int|null $limit
  * @return Builder
  */
 public function scopeRecentlyCreated(Builder $query, $limit = null)
 {
     $query->orderBy('created_at', 'desc');
     if ($limit) {
         $query->limit($limit);
     }
     return $query;
 }
开发者ID:NuclearCMS,项目名称:Hierarchy,代码行数:15,代码来源:Node.php

示例4: limitCriterion

 public function limitCriterion(QueryBuilder $query, $limit)
 {
     return $query->limit($limit);
 }
开发者ID:monospice,项目名称:spicy-repositories,代码行数:4,代码来源:BasicCriteria.php

示例5: apply

 /**
  * @param \Illuminate\Database\Eloquent\Builder $model
  * @param RepositoryInterface $repository
  * @return mixed
  */
 public function apply($model, Repository $repository)
 {
     return $model->limit(15);
 }
开发者ID:DiSiqueira,项目名称:TheOscars,代码行数:9,代码来源:Limit15.php

示例6: process

 /**
  * @param Builder|EloquentBuilder $src
  * @param OperationInterface|PaginateOperation $operation
  * @return mixed
  */
 public function process($src, OperationInterface $operation)
 {
     $src->limit($operation->getPageSize())->offset($this->getOffset($operation));
     return $src;
 }
开发者ID:view-components,项目名称:eloquent-data-processing,代码行数:10,代码来源:PaginateProcessor.php

示例7: limit

 /**
  * Limit the number of rows returned
  *
  * @param  integer $limit
  * @return $this
  */
 public function limit($limit)
 {
     $this->builder = $this->builder->limit($limit);
     return $this;
 }
开发者ID:kodebyraaet,项目名称:pattern,代码行数:11,代码来源:BaseRepository.php

示例8: limit

 public function limit($limit)
 {
     $this->original->limit($limit);
     return $this;
 }
开发者ID:wutongwan,项目名称:laravel-lego,代码行数:5,代码来源:EloquentTable.php


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