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


PHP Builder::setBindings方法代码示例

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


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

示例1: compileJoins

 protected function compileJoins(LaravelBaseBuilder $query, $joins)
 {
     $sql = array();
     $query->setBindings(array(), 'join');
     foreach ($joins as $join) {
         $table = $this->wrapTable($join->table);
         // First we need to build all of the "on" clauses for the join. There may be many
         // of these clauses so we will need to iterate through each one and build them
         // separately, then we'll join them up into a single string when we're done.
         $clauses = array();
         foreach ($join->clauses as $where) {
             if (isset($where['type'])) {
                 $method = "where{$where['type']}";
                 $clauses[] = $where['boolean'] . ' ' . $this->{$method}($query, $where);
             } else {
                 $clauses[] = $this->compileJoinConstraint($where);
             }
         }
         foreach ($join->bindings as $binding) {
             $query->addBinding($binding, 'join');
         }
         // Once we have constructed the clauses, we'll need to take the boolean connector
         // off of the first clause as it obviously will not be required on that clause
         // because it leads the rest of the clauses, thus not requiring any boolean.
         $clauses[0] = $this->removeLeadingBoolean($clauses[0]);
         $clauses = implode(' ', $clauses);
         $type = $join->type;
         // Once we have everything ready to go, we will just concatenate all the parts to
         // build the final join statement SQL for the query and we can then return the
         // final clause back to the callers as a single, stringified join statement.
         $sql[] = "{$type} join {$table} on ({$clauses})";
     }
     return implode(' ', $sql);
 }
开发者ID:fembri,项目名称:eloficient,代码行数:34,代码来源:MysqlGrammar.php

示例2: setBindings

 /**
  * Set the bindings on the query builder.
  *
  * @param array $bindings
  * @param string $type
  * @return $this 
  * @throws \InvalidArgumentException
  * @static 
  */
 public static function setBindings($bindings, $type = 'where')
 {
     return \Illuminate\Database\Query\Builder::setBindings($bindings, $type);
 }
开发者ID:satriashp,项目名称:tour,代码行数:13,代码来源:_ide_helper.php

示例3: removeBinding

 /**
  * Remove scope constraint from the query.
  *
  * @param  \Illuminate\Database\Query\Builder $builder
  * @param  int $key
  * @return void
  */
 protected function removeBinding(BaseBuilder $query, $key)
 {
     $bindings = $query->getRawBindings()['where'];
     unset($bindings[$key]);
     $query->setBindings($bindings);
 }
开发者ID:oimken,项目名称:sharp,代码行数:13,代码来源:SharpLanguageScope.php

示例4: setBindings

 /**
  * Set the bindings on the query builder.
  *
  * @param array $bindings
  * @return \Illuminate\Database\Query\Builder 
  * @static 
  */
 public static function setBindings($bindings)
 {
     return \Illuminate\Database\Query\Builder::setBindings($bindings);
 }
开发者ID:jorzhikgit,项目名称:MLM-Nexus,代码行数:11,代码来源:_ide_helper.php

示例5: removeBindings

 /**
  * Remove bindings from the query builder.
  *
  * @param  \Illuminate\Database\Query\Builder $query
  * @param  integer $key
  * @param  integer $count
  * @return void
  */
 protected function removeBindings(Query $query, $key, $count)
 {
     $bindings = $query->getRawBindings()['where'];
     array_splice($bindings, $key, $count);
     $query->setBindings($bindings, 'where');
 }
开发者ID:k1ng440,项目名称:laravel-global-scope,代码行数:14,代码来源:GlobalScope.php


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