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