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


PHP Builder::lists方法代碼示例

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


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

示例1: lists

 /**
  * @param  string $value
  * @param  string $key
  * @return array
  */
 public function lists($value, $key = null)
 {
     $this->applyCriteria();
     $this->newQuery()->eagerLoadRelations();
     $lists = $this->model->lists($value, $key);
     if (is_array($lists)) {
         return $lists;
     }
     return $lists->all();
 }
開發者ID:jonphipps,項目名稱:Repositories,代碼行數:15,代碼來源:Repository.php

示例2: lists

 /**
  * Get an array with the values of a given column.
  *
  * @param  string $value
  * @param  string $key
  *
  * @return array
  */
 public function lists($value, $key = null)
 {
     $this->newQuery();
     $lists = $this->query->lists($value, $key);
     if (is_array($lists)) {
         return $lists;
     }
     return $lists->all();
 }
開發者ID:raditv,項目名稱:laravel-repository,代碼行數:17,代碼來源:AbstractRepository.php

示例3: lists

 /**
  * Get an array with the values of a given column.
  *
  * @param      $column
  * @param null $key
  * @return \Illuminate\Support\Collection
  */
 public function lists($column, $key = null)
 {
     // Save the results from the builder
     $results = $this->builder->lists($column, $key);
     // Reset the builder, just in case we are going to use this repository more then once
     $this->newBuilder();
     // Return stuff
     return $results;
 }
開發者ID:kodebyraaet,項目名稱:pattern,代碼行數:16,代碼來源:BaseRepository.php

示例4: valuesFrom

 /**
  * Automatically gets the values from an Eloquent class/query
  *
  * @param \Illuminate\Database\Eloquent\Builder|string $query
  * @param string $key column to use as values
  * @param null|string $label column to use as value label, if null it will match the value
  * @return $this
  */
 function valuesFrom($query, $key, $label = null)
 {
     if (!$label) {
         $label = $key;
     }
     if ($query instanceof \Illuminate\Database\Eloquent\Builder) {
         $rs = $query->lists($label, $key);
     } else {
         $rs = call_user_func([$query, 'lists'], $label, $key);
     }
     $this->values($rs->toArray());
     return $this;
 }
開發者ID:plokko,項目名稱:FormBuilder,代碼行數:21,代碼來源:SelectField.php

示例5: lists

 /**
  * Get an array with the values of a given column.
  *
  * @param string $column
  * @param string|null $key
  * @return \Illuminate\Support\Collection 
  * @static 
  */
 public static function lists($column, $key = null)
 {
     return \Illuminate\Database\Eloquent\Builder::lists($column, $key);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:12,代碼來源:_ide_helper.php

示例6: getList

 /**
  * @param string|int $value
  * @param string     $key
  *
  * @return \Illuminate\Database\Eloquent\Collection
  */
 public function getList($value, $key = 'id')
 {
     return $this->model->lists($value, $key);
 }
開發者ID:torome,項目名稱:defender,代碼行數:10,代碼來源:AbstractEloquentRepository.php


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