当前位置: 首页>>代码示例>>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;未经允许,请勿转载。