當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SqlWalker::walkSelectClause方法代碼示例

本文整理匯總了PHP中Doctrine\ORM\Query\SqlWalker::walkSelectClause方法的典型用法代碼示例。如果您正苦於以下問題:PHP SqlWalker::walkSelectClause方法的具體用法?PHP SqlWalker::walkSelectClause怎麽用?PHP SqlWalker::walkSelectClause使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine\ORM\Query\SqlWalker的用法示例。


在下文中一共展示了SqlWalker::walkSelectClause方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: walkSelectClause

 /**
  * Walks down a SelectClause AST node, thereby generating the appropriate SQL.
  *
  * @param $selectClause
  * @return string The SQL.
  */
 public function walkSelectClause($selectClause)
 {
     $sql = parent::walkSelectClause($selectClause);
     if ($this->getQuery()->getHint('mysqlWalker.count') === true) {
         $sql = str_replace('SELECT', 'SELECT SQL_CALC_FOUND_ROWS', $sql);
     }
     return $sql;
 }
開發者ID:TMSolution,項目名稱:DataGridBundle,代碼行數:14,代碼來源:MysqlWalker.php

示例2: walkSelectClause

 /**
  * Walks down a SelectClause AST node, thereby generating the appropriate SQL.
  *
  * @param $selectClause
  * @return string The SQL.
  */
 public function walkSelectClause($selectClause)
 {
     $sql = parent::walkSelectClause($selectClause);
     if ($this->getQuery()->getHint('mysqlWalker.sqlNoCache') === true) {
         if ($selectClause->isDistinct) {
             $sql = str_replace('SELECT DISTINCT', 'SELECT DISTINCT SQL_NO_CACHE', $sql);
         } else {
             $sql = str_replace('SELECT', 'SELECT SQL_NO_CACHE', $sql);
         }
     }
     return $sql;
 }
開發者ID:pabloasc,項目名稱:test_social,代碼行數:18,代碼來源:MysqlWalker.php

示例3: walkSelectClause

 public function walkSelectClause($selectClause)
 {
     $sql = parent::walkSelectClause($selectClause);
     if ($this->getQuery()->getHint(self::HINT_SQL_NO_CACHE) === true) {
         if ($selectClause->isDistinct) {
             $sql = str_replace('SELECT DISTINCT', 'SELECT DISTINCT SQL_NO_CACHE', $sql);
         } else {
             $sql = str_replace('SELECT', 'SELECT SQL_NO_CACHE ', $sql);
         }
     }
     if ($this->getQuery()->getHint(self::HINT_STRAIGHT_JOIN) === true) {
         $sql = str_replace('SELECT', 'SELECT STRAIGHT_JOIN ', $sql);
     }
     return $sql;
 }
開發者ID:GerDner,項目名稱:luck-docker,代碼行數:15,代碼來源:ForceIndexWalker.php

示例4: walkSelectClause

 /** {@inheritDoc} */
 public function walkSelectClause($selectClause)
 {
     $sql = parent::walkSelectClause($selectClause);
     // Gets the query
     $query = $this->getQuery();
     if ($query->getHint('mysqlWalker.sqlCalcFoundRows') === true) {
         // Appends the SQL_CALC_FOUND_ROWS modifier
         $sql = str_replace('SELECT', 'SELECT SQL_CALC_FOUND_ROWS', $sql);
     }
     if ($query->getHint('mysqlWalker.sqlNoCache') === true) {
         // Appends the SQL_NO_CACHE modifier
         $sql = str_replace('SELECT', 'SELECT SQL_NO_CACHE', $sql);
     }
     return $sql;
 }
開發者ID:beberlei,項目名稱:doctrineextensions,代碼行數:16,代碼來源:MysqlWalker.php

示例5: walkSelectClause

 /**
  * @param \Doctrine\ORM\Query\AST\SelectClause $selectClause
  * @return mixed|string
  */
 public function walkSelectClause($selectClause)
 {
     /** @var \Carnage\Watson\Configuration $config */
     $config = $this->getEntityManager()->getConfiguration();
     $logger = $config->getWatsonLogger();
     $logger->nextQuery();
     $sql = parent::walkSelectClause($selectClause);
     $querySource = $this->findQuerySource();
     if ($config->addQueryComment()) {
         $comment = ' -- ' . $querySource['file'] . ':' . $querySource['line'] . "\n";
         $sql = preg_replace('/SELECT/', 'SELECT ' . $comment, $sql, 1);
     }
     $logger->logQuerySource($querySource['file'], $querySource['line']);
     $this->attachHydrator();
     return $sql;
 }
開發者ID:carnage,項目名稱:watson,代碼行數:20,代碼來源:SqlWalker.php

示例6: walkSelectClause

 /**
  * {@inheritDoc}
  */
 public function walkSelectClause($selectClause)
 {
     $result = parent::walkSelectClause($selectClause);
     $result = $this->replace($this->replacements, $result);
     return $result;
 }
開發者ID:ilosada,項目名稱:chamilo-lms-icpna,代碼行數:9,代碼來源:TranslationWalker.php

示例7: walkSelectClause

 /**
  * {@inheritDoc}
  */
 public function walkSelectClause($selectClause)
 {
     $result = parent::walkSelectClause($selectClause);
     $fallbackSql = '';
     if ($this->needsFallback() && count($this->translatedComponents)) {
         $fallbackAliases = array();
         foreach ($this->replacements as $dqlAlias => $trans) {
             if (preg_match("/{$dqlAlias} AS ([^\\s]+)/smi", $result, $m)) {
                 list($tblAlias, $colName) = explode('.', $dqlAlias);
                 $fallback = $this->getSQLColumnAlias($colName . '_fallback');
                 $fallbackSql .= ', ' . $dqlAlias . ' AS ' . $fallback;
                 $fallbackAliases[$fallback] = rtrim($m[1], ',');
             }
         }
         $this->getQuery()->setHint(self::HINT_TRANSLATION_FALLBACKS, $fallbackAliases);
     }
     $result = str_replace(array_keys($this->replacements), array_values($this->replacements), $result);
     $result .= $fallbackSql;
     return $result;
 }
開發者ID:rdohms,項目名稱:DoctrineExtensions,代碼行數:23,代碼來源:TranslationWalker.php

示例8: walkSelectClause

 /**
  * Walks down a SelectClause AST node, thereby generating the appropriate SQL.
  *
  * @param $selectClause
  * @return string The SQL.
  */
 public function walkSelectClause($selectClause)
 {
     $sql = parent::walkSelectClause($selectClause);
     if ($this->getQuery()->getHint('librinfoWalker.noIlike') === false) {
         $sql = str_replace('LIKE', 'ILIKE', $sql);
     }
     return $sql;
 }
開發者ID:libre-informatique,項目名稱:SymfonyLibrinfoDoctrinePgsqlBundle,代碼行數:14,代碼來源:LibrinfoWalker.php


注:本文中的Doctrine\ORM\Query\SqlWalker::walkSelectClause方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。