本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例6: walkSelectClause
/**
* {@inheritDoc}
*/
public function walkSelectClause($selectClause)
{
$result = parent::walkSelectClause($selectClause);
$result = $this->replace($this->replacements, $result);
return $result;
}
示例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;
}
示例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;
}