コード例 #1
0
ファイル: SubstringFunction.php プロジェクト: yamildiego/JY
 /**
  * @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);
 }
コード例 #2
0
ファイル: Atan.php プロジェクト: uppaljs/pakistan-vlmis-v2
 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 : '') . ')';
 }
コード例 #3
0
ファイル: LocateFunction.php プロジェクト: jackbravo/doctrine
 /**
  * @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 . ')';
 }
コード例 #4
0
 /**
  * {@inheritdoc}
  */
 public function getSql(SqlWalker $sqlWalker)
 {
     // This type is defined by ANSI SQL
     $targetType = 'VARCHAR';
     // MySQL needs a CHAR type for string conversion (http://dev.mysql.com/doc/refman/5.7/en/type-conversion.html)
     if ($sqlWalker->getConnection()->getDatabasePlatform()->getName() === 'mysql') {
         $targetType = 'CHAR';
     }
     return 'CAST(' . $sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary) . ' AS ' . $targetType . ')';
 }
コード例 #5
0
 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     return $sqlWalker->getConnection()->getDatabasePlatform()->getLocateExpression($sqlWalker->walkStringPrimary($this->secondStringPrimary), $sqlWalker->walkStringPrimary($this->firstStringPrimary), $this->simpleArithmeticExpression ? $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) : false);
 }
コード例 #6
0
 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     return 'MONTH(' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleDate) . ')';
 }
コード例 #7
0
ファイル: SqrtFunction.php プロジェクト: pabloasc/test_social
 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     //TODO: Use platform to get SQL
     return 'SQRT(' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) . ')';
 }
コード例 #8
0
ファイル: Atan2.php プロジェクト: pabloasc/test_social
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     $firstArgument = $sqlWalker->walkSimpleArithmeticExpression($this->firstExpression);
     $secondArgument = $sqlWalker->walkSimpleArithmeticExpression($this->secondExpression);
     return 'ATAN2(' . $firstArgument . ', ' . $secondArgument . ')';
 }
コード例 #9
0
ファイル: Asin.php プロジェクト: uppaljs/pakistan-vlmis-v2
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     return 'ASIN(' . $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression) . ')';
 }
コード例 #10
0
ファイル: IntvalFunction.php プロジェクト: kirkbauer2/kirkxc
 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     return 'CONVERT(' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) . ', UNSIGNED)';
 }
コード例 #11
0
 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     //TODO: Use platform to get SQL
     $sql = 'SUBSTRING(' . $sqlWalker->walkStringPrimary($this->_stringPrimary) . ', ' . $sqlWalker->walkSimpleArithmeticExpression($this->_firstSimpleArithmeticExpression) . ', ' . $sqlWalker->walkSimpleArithmeticExpression($this->_secondSimpleArithmeticExpression) . ')';
     return $sql;
 }
コード例 #12
0
 public function getSql(SqlWalker $sqlWalker)
 {
     return sprintf('VARIANCE(%s)', $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression));
 }
コード例 #13
0
 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     //TODO: Use platform to get SQL
     return 'LOCATE(' . $sqlWalker->walkStringPrimary($this->firstStringPrimary) . ', ' . $sqlWalker->walkStringPrimary($this->secondStringPrimary) . ($this->simpleArithmeticExpression ? ', ' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) : '') . ')';
 }
コード例 #14
0
ファイル: Randp.php プロジェクト: iakumai/doctrine-functions
 public function getSql(SqlWalker $sqlWalker)
 {
     return 'RAND(' . $sqlWalker->walkSimpleArithmeticExpression($this->value) . ')';
 }
コード例 #15
0
ファイル: Sha2.php プロジェクト: matiasraies/Symfony2Inta
 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     return 'SHA2(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ',' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) . ')';
 }
コード例 #16
0
ファイル: RadiansFunction.php プロジェクト: geoffreytran/zym
 /**
  * Get SQL
  *
  * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker
  * @return string
  */
 public function getSql(SqlWalker $sqlWalker)
 {
     return 'RADIANS(' . $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression) . ')';
 }
コード例 #17
0
 public final function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     return strtoupper($this->getMathFunctionName()) . '(' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) . ')';
 }
コード例 #18
0
 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     return $sqlWalker->getConnection()->getDatabasePlatform()->getUpperExpression($sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary));
 }
コード例 #19
0
ファイル: IfnullFunction.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Get SQL query part
  * 
  * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker SQL walker
  *  
  * @return string
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     return 'IFNULL(' . $sqlWalker->walkSimpleArithmeticExpression($this->ifThen) . ', ' . $sqlWalker->walkSimpleArithmeticExpression($this->ifElse) . ')';
 }
コード例 #20
0
 /**
  * @override
  */
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     return $sqlWalker->getConnection()->getDatabasePlatform()->getModExpression($sqlWalker->walkSimpleArithmeticExpression($this->firstSimpleArithmeticExpression), $sqlWalker->walkSimpleArithmeticExpression($this->secondSimpleArithmeticExpression));
 }
コード例 #21
0
ファイル: Std.php プロジェクト: digvijaymohite/e-tender
 public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
 {
     return sprintf('STD(%s)', $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression));
 }