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