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


PHP Builder::getModels方法代碼示例

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


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

示例1: getModels

 /**
  * @param array $columns
  *
  * @return \Illuminate\Database\Eloquent\Model[]
  */
 public function getModels($columns = array('*'))
 {
     if (count($this->query->orders) == 0) {
         $this->orderBy(static::COLUMN_MODEL_ID);
     }
     return parent::getModels($columns);
 }
開發者ID:arcstone,項目名稱:eloquent-versioned,代碼行數:12,代碼來源:Builder.php

示例2: getModels

 /**
  * Get the hydrated models without eager loading.
  *
  * @param  array  $columns
  * @return array|static[]
  */
 public function getModels($columns = array('*'))
 {
     $model = $this->model;
     $this->query = $model::callBuildingQueryEvent($this->query);
     if (!is_a($this->query, 'Illuminate\\Database\\Query\\Builder')) {
         throw new \Exception("\$query must be an instance of \\Illuminate\\Database\\Query\\Builder");
     }
     $this->builderOrderBy();
     return parent::getModels($columns);
 }
開發者ID:innoscience,項目名稱:eloquental,代碼行數:16,代碼來源:Builder.php

示例3: getModels

 /**
  * @param array $columns
  * @return \Illuminate\Database\Eloquent\Model[]
  */
 public function getModels($columns = ['*'])
 {
     foreach ($this->eagerLoad as $name => $constraints) {
         if ($this->isNestedRelation($name)) {
             continue;
         }
         $relation = $this->getRelation($name);
         if ($this->isReferencedInQuery($name) && $this->isRelationSupported($relation)) {
             $this->disableEagerLoad($name);
             $this->addJoinToQuery($name, $this->model->getTable(), $relation);
             $this->addNestedRelations($name, $relation);
             $query = $relation->getQuery()->getQuery();
             $wheres = $query->wheres;
             $bindings = $query->getBindings();
             $this->mergeWheres($wheres, $bindings);
         }
     }
     $this->selectFromQuery($this->model->getTable(), '*');
     return parent::getModels($columns);
 }
開發者ID:leloulight,項目名稱:trigglog,代碼行數:24,代碼來源:WithJoinEloquentBuilder.php

示例4: getModels

 /**
  * Get the hydrated models without eager loading.
  *
  * @param array $columns
  * @return \Illuminate\Database\Eloquent\Model[] 
  * @static 
  */
 public static function getModels($columns = array())
 {
     return \Illuminate\Database\Eloquent\Builder::getModels($columns);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:11,代碼來源:_ide_helper.php


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