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


PHP Builder::toBase方法代码示例

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


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

示例1: initialize

 /**
  * Initialize
  *
  * @return void
  */
 public function initialize()
 {
     if (!$this->initialized) {
         $query = $this->builder->toBase();
         $sql = $query->toSql();
         $bindings = $query->getBindings();
         $conn = $query->getConnection();
         $this->statement = $conn->getPdo()->prepare($sql);
         $this->statement->execute($conn->prepareBindings($bindings));
         $this->prototype = $this->builder->getModel()->newFromBuilder();
     }
     $this->initialized = true;
 }
开发者ID:naturalweb,项目名称:nwlaravel,代码行数:18,代码来源:BuilderResultset.php

示例2: paginate

 /**
  * Paginate the returned set of models.
  *
  * @param  int      $perPage
  * @param  array    $columns
  * @param  string   $pageName
  * @param  int|null $page
  * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
  *
  * @throws \InvalidArgumentException
  */
 public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null)
 {
     $query = $this->model->toBase();
     $total = $query->getCountForPagination();
     $model = $this->model->forPage($page = $page ?: Paginator::resolveCurrentPage($pageName), $perPage = $perPage ?: $this->model->getPerPage());
     $results = new LengthAwarePaginator($this->hookPaginate($model->get($columns)), $total, $perPage, $page, ['path' => Paginator::resolveCurrentPath(), 'pageName' => $pageName]);
     $this->reset();
     return $results;
 }
开发者ID:propaganistas,项目名称:laravel-repository,代码行数:20,代码来源:Repository.php

示例3: toBase

 /**
  * Get a base query builder instance.
  *
  * @return \Illuminate\Database\Query\Builder 
  * @static 
  */
 public static function toBase()
 {
     return \Illuminate\Database\Eloquent\Builder::toBase();
 }
开发者ID:andybolano,项目名称:viaja_seguro,代码行数:10,代码来源:_ide_helper.php

示例4: addHasWhere

 /**
  * Add the "has" condition where clause to the query.
  *
  * @param  \Illuminate\Database\Eloquent\Builder  $hasQuery
  * @param  \Illuminate\Database\Eloquent\Relations\Relation  $relation
  * @param  string  $operator
  * @param  int  $count
  * @param  string  $boolean
  * @return \Illuminate\Database\Eloquent\Builder|static
  */
 protected function addHasWhere(Builder $hasQuery, Relation $relation, $operator, $count, $boolean)
 {
     $hasQuery->mergeModelDefinedRelationConstraints($relation->getQuery());
     if ($this->shouldRunExistsQuery($operator, $count)) {
         $not = $operator === '<' && $count === 1;
         return $this->addWhereExistsQuery($hasQuery->toBase(), $boolean, $not);
     }
     return $this->whereCountQuery($hasQuery->toBase(), $operator, $count, $boolean);
 }
开发者ID:levanigongadze,项目名称:Labweb,代码行数:19,代码来源:Builder.php

示例5: parsePagination

 protected function parsePagination(array $params, Query $query)
 {
     $page = isset($params['page']) ? $params['page'] : 1;
     $this->maxPages = (int) ceil($query->toBase()->getCountForPagination() / self::UNITS_PER_PAGE);
     return $query->forPage($page, self::UNITS_PER_PAGE);
 }
开发者ID:xandros15,项目名称:aigisu,代码行数:6,代码来源:UnitSearch.php


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