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


PHP Builder::get方法代码示例

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


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

示例1: get

 /**
  * Get records from the database.
  *
  * @param int $per_page
  *
  * @return Collection
  */
 public function get($per_page = 20)
 {
     $this->per_page = $per_page;
     $this->buildQuery();
     return $this->query->get();
 }
开发者ID:bhutanio,项目名称:laravel-utilities,代码行数:13,代码来源:DbRepository.php

示例2: getModels

 /**
  * Get the hydrated models without eager loading.
  *
  * @param  array  $columns
  * @return \Illuminate\Database\Eloquent\Model[]
  */
 public function getModels($columns = ['*'])
 {
     $results = $this->query->get($columns);
     $connection = $this->model->getConnectionName();
     return $this->model->hydrate($results, $connection)->all();
 }
开发者ID:drickferreira,项目名称:rastreador,代码行数:12,代码来源:Builder.php

示例3: afterOperations

 /**
  * @param Builder|EloquentBuilder $data
  * @return Traversable
  */
 protected function afterOperations($data)
 {
     if ($data instanceof EloquentBuilder) {
         return $data->get();
     } elseif ($data instanceof Builder) {
         return new ArrayIterator($data->get());
     }
     throw new RuntimeException('Unsupported type of data source.');
 }
开发者ID:view-components,项目名称:eloquent-data-processing,代码行数:13,代码来源:EloquentProcessingService.php

示例4: totalCount

 public function totalCount()
 {
     if ($this->options['distinctCountGroup'] && count($this->originalBuilder->groups) == 1) {
         $this->originalBuilder->groups = null;
     }
     if ($this->options['searchWithAlias']) {
         $cnt = count($this->originalBuilder->get());
     } else {
         $cnt = $this->originalBuilder->count();
     }
     return $cnt;
 }
开发者ID:summer11123,项目名称:Datatable,代码行数:12,代码来源:QueryEngine.php

示例5: findWhere

 /**
  * Find data by multiple fields
  *
  * @param array $where
  * @param array $columns
  * @return mixed|Model
  */
 public function findWhere(array $where, $columns = ['*'])
 {
     return $this->wrap(function ($where, $columns = ['*']) {
         $this->applyWhere($where);
         return $this->model->get($columns);
     }, new Action(__METHOD__, func_get_args(), Action::READ));
 }
开发者ID:sandeeprajoria,项目名称:Housekeeper,代码行数:14,代码来源:BaseRepository.php

示例6: getResult

 /**
  * Gets results from prepared query
  *
  * @return null
  */
 protected function getResult()
 {
     if ($this->query_type == 'eloquent') {
         $this->result_object = $this->query->get();
         $this->result_array = $this->result_object->toArray();
     } else {
         $this->result_object = $this->query->get();
         $this->result_array = array_map(function ($object) {
             return (array) $object;
         }, $this->result_object);
     }
     if ($this->dataFullSupport) {
         $walk = function ($value, $key, $prefix = null) use(&$walk, &$result_array) {
             $key = !is_null($prefix) ? $prefix . "." . $key : $key;
             if (is_array($value)) {
                 array_walk($value, $walk, $key);
             } else {
                 $result_array = Arr::add($result_array, $key, $value);
             }
         };
         $result_array = array();
         array_walk($this->result_array, $walk);
         $this->result_array = $result_array;
     }
 }
开发者ID:khaidirh,项目名称:laravel4-datatables-package,代码行数:30,代码来源:Datatables.php

示例7: get

 /**
  * Execute the query as a "select" statement.
  *
  * @param  array  $columns
  * @return array|static[]
  */
 public function get($columns = array('*'))
 {
     if ($this->model instanceof Model) {
         $this->model->filterQuery($this, 'after');
     }
     return parent::get($columns);
 }
开发者ID:mayoz,项目名称:eloquent-filterable,代码行数:13,代码来源:QueryBuilder.php

示例8: get

 /**
  * Execute the query as a "select" statement.
  *
  * @param  array  $columns
  * @return array|static[]
  */
 public function get($columns = ['*'])
 {
     if (null !== $this->cacheMinutes) {
         return $this->getCached($columns);
     }
     return parent::get($columns);
 }
开发者ID:BePsvPT,项目名称:CCU,代码行数:13,代码来源:Builder.php

示例9: get

 /**
  * Execute the query as a "select" statement.
  *
  * @param  array  $columns
  * @return array|static[]
  */
 public function get($columns = array('*'))
 {
     if (!is_null($this->cacheMinutes)) {
         return $this->getCached($columns);
     }
     return parent::get($columns);
 }
开发者ID:nguyentamvinhlong,项目名称:rememberable,代码行数:13,代码来源:Builder.php

示例10: build

 /**
  * flush events, build pagination and sort items
  * 
  * @return $this
  */
 public function build()
 {
     BurpEvent::flush('dataset.sort');
     BurpEvent::flush('dataset.page');
     $this->paginator = Paginator::make($this->total_rows, $this->per_page, $this->page);
     $offset = $this->paginator->offset();
     $this->limit($this->per_page, $offset);
     if (is_array($this->source)) {
         //orderby
         if (isset($this->orderby)) {
             list($field, $direction) = $this->orderby;
             array_orderby($this->source, $field, $direction);
         }
         //limit-offset
         if (isset($this->limit)) {
             $this->source = array_slice($this->source, $this->limit[1], $this->limit[0]);
         }
         $this->data = $this->source;
     } else {
         //orderby
         if (isset($this->orderby)) {
             $this->query = $this->query->orderBy($this->orderby[0], $this->orderby[1]);
         }
         //limit-offset
         if (isset($this->per_page)) {
             $this->query = $this->query->skip($offset)->take($this->per_page);
         }
         $this->data = $this->query->get();
     }
     return $this;
 }
开发者ID:faizan31,项目名称:datagrid,代码行数:36,代码来源:DataSet.php

示例11: results

 /**
  * Return all of the results.
  *
  * @return array
  * @throws TableNotSetException
  */
 public function results()
 {
     if (!$this->query) {
         throw new TableNotSetException("You must set a database table to get results from.");
     }
     return $this->query->get($this->select);
 }
开发者ID:michaeljennings,项目名称:carpenter,代码行数:13,代码来源:Illuminate.php

示例12: get

 public function get($columns = array('*'))
 {
     for ($n = 0; $n < count($columns); $n++) {
         $columns[$n] = is_string($columns[$n]) ? snake_case($columns[$n]) : $columns[$n];
     }
     return parent::get($columns);
     // TODO: Change the autogenerated stub
 }
开发者ID:jgraffite,项目名称:snake2camel,代码行数:8,代码来源:QueryBuilder.php

示例13: get

 /**
  * Execute the query as a "select" statement.
  *
  * @param  array $columns
  * @return array|static[]
  */
 public function get($columns = ['*'])
 {
     $cacheKey = $this->generateCacheKey();
     if (null === ($results = $this->cache->tags($this->cacheTag)->get($cacheKey))) {
         $results = parent::get($columns);
         $this->cache->tags($this->cacheTag)->forever($cacheKey, $results);
     }
     return $results;
 }
开发者ID:bedemiralp,项目名称:InfinityCache,代码行数:15,代码来源:Builder.php

示例14: get

 /**
  * get list
  *
  * @param array $columns get columns list
  * @return array|static[]
  */
 public function get(array $columns = ['*'])
 {
     if ($this->dynamic === false) {
         return $this->query->get($columns);
     }
     if ($this->proxy === true) {
         $this->query = $this->getProxyManager()->get($this->query);
     }
     return $this->query->get($columns);
 }
开发者ID:mint-soft-com,项目名称:xpressengine,代码行数:16,代码来源:DynamicQuery.php

示例15: make

 /**
  * Returns HTML with resource table
  *
  * @return string
  * @throws CollectionException
  */
 public function make()
 {
     if (empty($this->_columns)) {
         throw new CollectionException('At least one column is required to generate a resource table.');
     }
     // Prepare builder object before calling Table
     $this->_prepareBuilder();
     // Finally execute prepared query builder
     $items = $this->_builder->get();
     return with(new Table($items, ['collection_generator' => $this, 'columns' => $this->_columns, 'per_page' => $this->_perPage, 'paginate' => $this->_paginate, 'paginator_presenter' => $this->_getPaginatorPresenter($items), 'view_name' => $this->_viewName, 'filter' => $this->_filter, 'extra' => $this->_extraViewData]))->make();
 }
开发者ID:msieprawski,项目名称:resource-table,代码行数:17,代码来源:Collection.php


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