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


PHP Query\SqlWalker類代碼示例

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


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

示例1: getSql

 public function getSql(SqlWalker $sqlWalker)
 {
     $args = array_map(function ($value) use($sqlWalker) {
         return $sqlWalker->walkArithmeticPrimary($value);
     }, $this->values);
     return 'GREATEST(' . implode(', ', $args) . ')';
 }
開發者ID:v3labs,項目名稱:doctrine-extensions,代碼行數:7,代碼來源:LeastFunction.php

示例2: getSql

 /**
  * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker
  *
  * @return string
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     // use second parameter if parsed
     if (null !== $this->fmt) {
         return sprintf('TRUNC(%s, %s)', $sqlWalker->walkArithmeticPrimary($this->date), $sqlWalker->walkArithmeticPrimary($this->fmt));
     }
     return sprintf('TRUNC(%s)', $sqlWalker->walkArithmeticPrimary($this->date));
 }
開發者ID:AlboVieira,項目名稱:aplicacaozend,代碼行數:13,代碼來源:Trunc.php

示例3: getSql

 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     $platform = $sqlWalker->getConnection()->getDatabasePlatform();
     if (!method_exists($platform, 'getStringAgg')) {
         return $sqlWalker->walkStringPrimary($this->firstStringPrimary);
     }
     return $platform->getStringAgg($sqlWalker->walkStringPrimary($this->firstStringPrimary), $sqlWalker->walkStringPrimary($this->secondStringPrimary));
 }
開發者ID:sgdoc,項目名稱:sgdoce-codigo,代碼行數:11,代碼來源:StringAggFunction.php

示例4: getSql

 /**
  * {@inheritdoc}
  */
 public function getSql(SqlWalker $sqlWalker)
 {
     $stringPrimary = $sqlWalker->walkStringPrimary($this->stringPrimary);
     $platform = $sqlWalker->getConnection()->getDatabasePlatform();
     $trimMode = $this->getTrimMode();
     $trimChar = $this->trimChar !== false ? $sqlWalker->getConnection()->quote($this->trimChar) : false;
     return $platform->getTrimExpression($stringPrimary, $trimMode, $trimChar);
 }
開發者ID:Dren-x,項目名稱:mobit,代碼行數:11,代碼來源:TrimFunction.php

示例5: getSql

 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     $secondArgument = '';
     if ($this->optionalSecondExpression) {
         $secondArgument = $sqlWalker->walkSimpleArithmeticExpression($this->optionalSecondExpression);
     }
     return 'ATAN(' . $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression) . ($secondArgument ? ', ' . $secondArgument : '') . ')';
 }
開發者ID:uppaljs,項目名稱:pakistan-vlmis-v2,代碼行數:8,代碼來源:Atan.php

示例6: getSql

 public function getSql(SqlWalker $sqlWalker)
 {
     $args = array_map(function ($value) use($sqlWalker) {
         $nodeSql = $sqlWalker->walkArithmeticPrimary($value);
         return $this->notEmpty ? sprintf("NULLIF(%s, '')", $nodeSql) : $nodeSql;
     }, $this->values);
     return 'CONCAT_WS(' . implode(', ', $args) . ')';
 }
開發者ID:v3labs,項目名稱:doctrine-extensions,代碼行數:8,代碼來源:ConcatWs.php

示例7: getSql

 /**
  * @param SqlWalker $sqlWalker
  * @return string
  */
 public function getSql(SqlWalker $sqlWalker)
 {
     $args = array();
     foreach ($this->concatExpressions as $expression) {
         $args[] = $sqlWalker->walkStringPrimary($expression);
     }
     return 'CONCAT_WS(' . join(', ', (array) $args) . ')';
 }
開發者ID:glauberkyves,項目名稱:mysql-functions-doctrine2,代碼行數:12,代碼來源:MysqlConcatWs.php

示例8: getSql

 /**
  * @param SqlWalker $sqlWalker
  *
  * @return string
  */
 public function getSql(SqlWalker $sqlWalker)
 {
     $this->validatePlatform($sqlWalker->getConnection()->getDatabasePlatform());
     if ($this->optionalExpression) {
         return sprintf('%s(%s, %s, %s)', $this->functionName, $this->firstGeomExpression->dispatch($sqlWalker), $this->secondGeomExpression->dispatch($sqlWalker), $this->optionalExpression->dispatch($sqlWalker));
     }
     return sprintf('%s(%s, %s)', $this->functionName, $this->firstGeomExpression->dispatch($sqlWalker), $this->secondGeomExpression->dispatch($sqlWalker));
 }
開發者ID:raketman,項目名稱:doctrine2-spatial,代碼行數:13,代碼來源:AbstractDualGeometryOptionalParameterDQLFunction.php

示例9: getSql

 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     $platform = $sqlWalker->getConnection()->getDatabasePlatform();
     $strings = array_map(function ($v) use($sqlWalker) {
         return $sqlWalker->walkStringPrimary($v);
     }, $this->strings);
     return call_user_func_array(array($platform, 'getConcatExpression'), $strings);
 }
開發者ID:saberyounis,項目名稱:Sonata-Project,代碼行數:11,代碼來源:MultiConcatFunction.php

示例10: getSql

 /**
  * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker
  * @return string
  */
 public function getSql(SqlWalker $sqlWalker)
 {
     $platform = $sqlWalker->getConnection()->getDatabasePlatform();
     if ($platform instanceof PostgreSqlPlatform) {
         return $this->getPostgreSql($sqlWalker);
     }
     throw new NotImplementedException();
 }
開發者ID:carrooi,項目名稱:doctrine,代碼行數:12,代碼來源:Field.php

示例11: getSql

 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     $optionalSecondSimpleArithmeticExpression = null;
     if ($this->secondSimpleArithmeticExpression !== null) {
         $optionalSecondSimpleArithmeticExpression = $sqlWalker->walkSimpleArithmeticExpression($this->secondSimpleArithmeticExpression);
     }
     return $sqlWalker->getConnection()->getDatabasePlatform()->getSubstringExpression($sqlWalker->walkStringPrimary($this->stringPrimary), $sqlWalker->walkSimpleArithmeticExpression($this->firstSimpleArithmeticExpression), $optionalSecondSimpleArithmeticExpression);
 }
開發者ID:yamildiego,項目名稱:JY,代碼行數:11,代碼來源:SubstringFunction.php

示例12: getSql

 /**
  * {@inheritdoc}
  */
 public function getSql(SqlWalker $sqlWalker)
 {
     $strings = array();
     $stringExpressions = $this->parameters[Base::STRINGS_KEY];
     foreach ($stringExpressions as $stringExp) {
         $strings[] = $sqlWalker->walkStringPrimary($stringExp);
     }
     return sprintf('CONCAT_WS(%s, %s)', $sqlWalker->walkStringPrimary($this->parameters[Base::SEPARATOR_KEY]), implode(', ', $strings));
 }
開發者ID:Hikariii,項目名稱:doctrine-extensions,代碼行數:12,代碼來源:ConcatWs.php

示例13: getSql

 /**
  * {@inheritdoc}
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     $strings = array();
     $stringExpressions = $this->parameters['strings'];
     foreach ($stringExpressions as $stringExp) {
         $strings[] = $sqlWalker->walkStringPrimary($stringExp);
     }
     return sprintf('CONCAT_WS(%s, %s)', $sqlWalker->walkStringPrimary($this->parameters['separator']), implode(', ', $strings));
 }
開發者ID:m3uzz,項目名稱:onionfw,代碼行數:12,代碼來源:ConcatWs.php

示例14: getSql

 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     //TODO: Use platform to get SQL
     $sql = 'LOCATE(' . $sqlWalker->walkStringPrimary($this->_firstStringPrimary) . ', ' . $sqlWalker->walkStringPrimary($this->_secondStringPrimary);
     if ($this->_simpleArithmeticExpression) {
         $sql .= ', ' . $sqlWalker->walkSimpleArithmeticExpression($this->_simpleArithmeticExpression);
     }
     return $sql . ')';
 }
開發者ID:jackbravo,項目名稱:doctrine,代碼行數:12,代碼來源:LocateFunction.php

示例15: getSql

 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     $sql = "WEEK(" . $sqlWalker->walkArithmeticPrimary($this->date);
     if ($this->mode != null) {
         $sql .= ", " . $sqlWalker->walkLiteral($this->mode);
     }
     $sql .= ")";
     return $sql;
 }
開發者ID:uppaljs,項目名稱:pakistan-vlmis-v2,代碼行數:12,代碼來源:Week.php


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