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


PHP Builder::setModel方法代码示例

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


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

示例1: newRawQuery

 /**
  * Get a new query builder for the model's table.
  *
  * @return \Illuminate\Database\Eloquent\Builder;
  */
 public function newRawQuery()
 {
     $builder = new Builder($this->newBaseQueryBuilder());
     // Once we have the query builders, we will set the model instances
     // so the builder can easily access any information it may need
     // from the model while it is constructing and executing various
     // queries against it.
     $builder->setModel($this)->with($this->with);
     return $builder;
 }
开发者ID:srlabs,项目名称:eloquent-sti,代码行数:15,代码来源:SingleTableInheritanceTrait.php

示例2: newQuery

 /**
  * Overriding newQuery() to the custom PostBuilder with some intereting methods
  * 
  * @param bool $excludeDeleted
  * @return Corcel\PostBuilder
  */
 public function newQuery($excludeDeleted = true)
 {
     $builder = new Builder($this->newBaseQueryBuilder());
     $builder->setModel($this);
     $builder->leftJoin('wp_term_taxonomy', 'wp_terms.term_id', '=', 'wp_term_taxonomy.term_id')->where('wp_term_taxonomy.taxonomy', '=', 'category')->select('wp_terms.*');
     if ($excludeDeleted and $this->softDelete) {
         $builder->whereNull($this->getQualifiedDeletedAtColumn());
     }
     return $builder;
 }
开发者ID:rajivseelam,项目名称:corcel,代码行数:16,代码来源:Category.php

示例3: setModel

 /**
  * Set a model instance for the model being queried.
  *
  * @param \Illuminate\Database\Eloquent\Model $model
  * @return $this 
  * @static 
  */
 public static function setModel($model)
 {
     return \Illuminate\Database\Eloquent\Builder::setModel($model);
 }
开发者ID:satriashp,项目名称:tour,代码行数:11,代码来源:_ide_helper.php

示例4: newQuery

 /**
  * Get a new query builder for the model's table.
  *
  * @param  bool  $excludeDeleted
  * @return \Illuminate\Database\Eloquent\Builder|static
  */
 public function newQuery($excludeDeleted = true)
 {
     $builder = new Builder($this->newBaseQueryBuilder());
     // Once we have the query builders, we will set the model instances so the
     // builder can easily access any information it may need from the model
     // while it is constructing and executing various queries against it.
     $builder->setModel($this)->with($this->with);
     if ($excludeDeleted and $this->softDelete) {
         $builder->whereNull($this->getQualifiedDeletedAtColumn());
     }
     return $builder;
 }
开发者ID:jcyh,项目名称:nder-firefly,代码行数:18,代码来源:Model.php

示例5: setModel

 /**
  * We automatically select all columns for the model to simplify some logic around select/addSelect
  *
  * @param \Illuminate\Database\Eloquent\Model $model
  * @return $this
  */
 public function setModel(Model $model)
 {
     parent::setModel($model);
     $this->select('*');
     return $this;
 }
开发者ID:Jchedev,项目名称:laravel-evolved,代码行数:12,代码来源:Builder.php


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