本文整理汇总了PHP中Doctrine\ORM\Query\SqlWalker::walkSimpleArithmeticExpression方法的典型用法代码示例。如果您正苦于以下问题:PHP SqlWalker::walkSimpleArithmeticExpression方法的具体用法?PHP SqlWalker::walkSimpleArithmeticExpression怎么用?PHP SqlWalker::walkSimpleArithmeticExpression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\ORM\Query\SqlWalker
的用法示例。
在下文中一共展示了SqlWalker::walkSimpleArithmeticExpression方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: 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 : '') . ')';
}
示例3: 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 . ')';
}
示例4: getSql
/**
* {@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: getSql
/**
* @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: getSql
/**
* @override
*/
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
return 'MONTH(' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleDate) . ')';
}
示例7: getSql
/**
* @override
*/
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
//TODO: Use platform to get SQL
return 'SQRT(' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) . ')';
}
示例8: getSql
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
$firstArgument = $sqlWalker->walkSimpleArithmeticExpression($this->firstExpression);
$secondArgument = $sqlWalker->walkSimpleArithmeticExpression($this->secondExpression);
return 'ATAN2(' . $firstArgument . ', ' . $secondArgument . ')';
}
示例9: getSql
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
return 'ASIN(' . $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression) . ')';
}
示例10: getSql
/**
* @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;
}
示例11: getSql
public function getSql(SqlWalker $sqlWalker)
{
return sprintf('VARIANCE(%s)', $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression));
}
示例12: getSql
/**
* @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) : '') . ')';
}
示例13: getSql
public function getSql(SqlWalker $sqlWalker)
{
return 'RAND(' . $sqlWalker->walkSimpleArithmeticExpression($this->value) . ')';
}
示例14: getSql
/**
* @override
*/
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
return 'SHA2(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ',' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) . ')';
}
示例15: getSql
/**
* Get SQL
*
* @param \Doctrine\ORM\Query\SqlWalker $sqlWalker
* @return string
*/
public function getSql(SqlWalker $sqlWalker)
{
return 'RADIANS(' . $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression) . ')';
}