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


PHP Builder::getQuery方法代码示例

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


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

示例1: databasePrefix

 /**
  * Returns current database prefix
  *
  * @return string
  */
 public function databasePrefix()
 {
     if ($this->query_type == 'builder') {
         $query = $this->query;
     } else {
         $query = $this->query->getQuery();
     }
     return $query->getGrammar()->getTablePrefix();
 }
开发者ID:testoodoo,项目名称:OoodooSiteUp,代码行数:14,代码来源:Datatables.php

示例2: dateFormatDb

 /**
  * Date Formate Database
  *
  * @param Builder  $query    Builder
  * @param string   $key      Column
  * @param string   $operator String Operator
  *
  * @return string
  */
 private function dateFormatDb($query, $key, $operator)
 {
     if (!$this->grammar) {
         $this->grammar = $query->getQuery()->getGrammar();
     }
     $key = $this->grammar->wrap($key);
     $formatDb = sprintf("%s %s ?", $key, $operator);
     switch (true) {
         case $this->grammar instanceof \Illuminate\Database\Query\Grammars\MySqlGrammar:
             $formatDb = sprintf("DATE(%s) %s ?", $key, $operator);
             break;
         case $this->grammar instanceof \Illuminate\Database\Query\Grammars\PostgresGrammar:
             $formatDb = sprintf("DATE_TRUNC('day', %s) %s ?", $key, $operator);
             break;
         case $this->grammar instanceof \Illuminate\Database\Query\Grammars\SQLiteGrammar:
             $formatDb = sprintf("strftime('%%Y-%%m-%%d', %s) %s ?", $key, $operator);
             break;
         case $this->grammar instanceof \Illuminate\Database\Query\Grammars\SqlServerGrammar:
             $formatDb = sprintf("CAST(%s AS DATE) %s ?", $key, $operator);
     }
     return $formatDb;
 }
开发者ID:naturalweb,项目名称:nwlaravel,代码行数:31,代码来源:InputCriteria.php

示例3: addForceDelete

 /**
  * Add the force delete extension to the builder.
  *
  * @param  \Illuminate\Database\Eloquent\Builder  $builder
  * @return void
  */
 protected function addForceDelete(Builder $builder)
 {
     $builder->macro('forceDelete', function (Builder $builder) {
         return $builder->getQuery()->delete();
     });
 }
开发者ID:fparralejo,项目名称:btrabajo,代码行数:12,代码来源:SoftDeletingScope.php

示例4: remove

 /**
  * Remove the scope from the given Eloquent query builder.
  *
  * @param  \Illuminate\Database\Eloquent\Builder  $builder
  * @param  \Illuminate\Database\Eloquent\Model  $model
  * @return void
  */
 public function remove(Builder $builder, Model $model)
 {
     $column = $model->getQualifiedDeletedAtColumn();
     $query = $builder->getQuery();
     $query->wheres = collect($query->wheres)->reject(function ($where) use($column) {
         return $this->isSoftDeleteConstraint($where, $column);
     })->values()->all();
 }
开发者ID:betes-curieuses-design,项目名称:ElieJosiePhotographie,代码行数:15,代码来源:SoftDeletingScope.php


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