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


PHP Query::type方法代码示例

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


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

示例1: compile

 /**
  * Returns the SQL representation of the provided query after generating
  * the placeholders for the bound values using the provided generator
  *
  * @param \Cake\Database\Query $query The query that is being compiled
  * @param \Cake\Database\ValueBinder $generator the placeholder generator to be used in expressions
  * @return \Closure
  */
 public function compile(Query $query, ValueBinder $generator)
 {
     $sql = '';
     $type = $query->type();
     $query->traverse($this->_sqlCompiler($sql, $query, $generator), $this->{'_' . $type . 'Parts'});
     return $sql;
 }
开发者ID:maitrepylos,项目名称:nazeweb,代码行数:15,代码来源:QueryCompiler.php

示例2: quote

 /**
  * Iterates over each of the clauses in a query looking for identifiers and
  * quotes them
  *
  * @param Query $query The query to have its identifiers quoted
  * @return Query
  */
 public function quote(Query $query)
 {
     $binder = $query->valueBinder();
     $query->valueBinder(false);
     if ($query->type() === 'insert') {
         $this->_quoteInsert($query);
     } else {
         $this->_quoteParts($query);
     }
     $query->traverseExpressions([$this, 'quoteExpression']);
     $query->valueBinder($binder);
     return $query;
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:20,代码来源:IdentifierQuoter.php

示例3: testDefaultType

 /**
  * Queries need a default type to prevent fatal errors
  * when an uninitialized query has its sql() method called.
  *
  * @return void
  */
 public function testDefaultType()
 {
     $query = new Query($this->connection);
     $this->assertEquals('', $query->sql());
     $this->assertEquals('select', $query->type());
 }
开发者ID:KarimaLadhani,项目名称:cakephp,代码行数:12,代码来源:QueryTest.php

示例4: compileQuery

 /**
  * Transforms the passed query to this Driver's dialect and returns an instance
  * of the transformed query and the full compiled SQL string
  *
  * @param \Cake\Database\Query $query The query to compile.
  * @param \Cake\Database\ValueBinder $generator The value binder to use.
  * @return array containing 2 entries. The first entity is the transformed query
  * and the second one the compiled SQL
  */
 public function compileQuery(Query $query, ValueBinder $generator)
 {
     $processor = $this->newCompiler();
     $translator = $this->queryTranslator($query->type());
     $query = $translator($query);
     return [$query, $processor->compile($query, $generator)];
 }
开发者ID:malhan23,项目名称:assignment-3,代码行数:16,代码来源:Driver.php

示例5: compile

 /**
  * Returns the SQL representation of the provided query after generating
  * the placeholders for the bound values using the provided generator
  *
  * @param \Cake\Database\Query $query The query that is being compiled
  * @param \Cake\Database\ValueBinder $generator the placeholder generator to be used in expressions
  * @return \Closure
  */
 public function compile(Query $query, ValueBinder $generator)
 {
     $sql = '';
     $type = $query->type();
     $query->traverse($this->_sqlCompiler($sql, $query, $generator), $this->{'_' . $type . 'Parts'});
     // Propagate bound parameters from sub-queries if the
     // placeholders can be found in the SQL statement.
     if ($query->valueBinder() !== $generator) {
         foreach ($query->valueBinder()->bindings() as $binding) {
             $placeholder = ':' . $binding['placeholder'];
             if (preg_match('/' . $placeholder . '(?:\\W|$)/', $sql) > 0) {
                 $generator->bind($placeholder, $binding['value'], $binding['type']);
             }
         }
     }
     return $sql;
 }
开发者ID:nrother,项目名称:cakephp,代码行数:25,代码来源:QueryCompiler.php


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