當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。