/** * @override */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { $platform = $sqlWalker->getConnection()->getDatabasePlatform(); if (!method_exists($platform, 'getTranslateExpression')) { return $sqlWalker->walkStringPrimary($this->firstStringPrimary); } return $platform->getTranslateExpression($sqlWalker->walkStringPrimary($this->firstStringPrimary), $sqlWalker->walkStringPrimary($this->stringFrom), $sqlWalker->walkStringPrimary($this->stringTo)); }
/** * @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)); }
/** * {@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)); }
/** * @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 . ')'; }
/** * {@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)); }
/** * @override */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { $platform = $sqlWalker->getConnection()->getDatabasePlatform(); return $platform->getConcatExpression($sqlWalker->walkStringPrimary($this->_firstStringPrimary), $sqlWalker->walkStringPrimary($this->_secondStringPrimary)); /* $sql = 'CONCAT(' . $sqlWalker->walkStringPrimary($this->_firstStringPrimary) . ', ' . $sqlWalker->walkStringPrimary($this->_secondStringPrimary) . ')'; return $sql;*/ }
/** * @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); }
/** * {@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); }
/** * @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) . ')'; }
/** * @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); }
/** * @override */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { $platform = $sqlWalker->getConnection()->getDatabasePlatform(); $args = array(); foreach ($this->concatExpressions as $expression) { $args[] = $sqlWalker->walkStringPrimary($expression); } return call_user_func_array(array($platform, 'getConcatExpression'), $args); }
/** * @override */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { $pos = AbstractPlatform::TRIM_UNSPECIFIED; if ($this->leading) { $pos = AbstractPlatform::TRIM_LEADING; } else { if ($this->trailing) { $pos = AbstractPlatform::TRIM_TRAILING; } else { if ($this->both) { $pos = AbstractPlatform::TRIM_BOTH; } } } return $sqlWalker->getConnection()->getDatabasePlatform()->getTrimExpression($sqlWalker->walkStringPrimary($this->stringPrimary), $pos, $this->trimChar != false ? $sqlWalker->getConnection()->quote($this->trimChar) : false); }
/** * @override */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { $sql = 'TRIM('; if ($this->leading) { $sql .= 'LEADING '; } else { if ($this->trailing) { $sql .= 'TRAILING '; } else { if ($this->both) { $sql .= 'BOTH '; } } } if ($this->trimChar) { $sql .= $sqlWalker->getConnection()->quote($this->trimChar) . ' '; } return $sql . 'FROM ' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')'; }
/** * @override */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { $sql = 'TRIM('; if ($this->_leading) { $sql .= 'LEADING '; } else { if ($this->_trailing) { $sql .= 'TRAILING '; } else { if ($this->_both) { $sql .= 'BOTH '; } } } if ($this->_trimChar) { $sql .= $this->_trimChar . ' '; } //TODO: quote() $sql .= 'FROM ' . $sqlWalker->walkStringPrimary($this->_stringPrimary); $sql .= ')'; return $sql; }
public function getSql(SqlWalker $sqlWalker) { return 'INET_ATON(' . $sqlWalker->walkStringPrimary($this->ip) . ')'; }
/** * @override */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { return $sqlWalker->getConnection()->getDatabasePlatform()->getMd5Expression($sqlWalker->walkStringPrimary($this->stringPrimary)); }
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { return $this->fname . '(' . $sqlWalker->walkStringPrimary($this->str) . ')'; }
/** * @override */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { return 'SHA2(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ',' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) . ')'; }
/** * @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); }
public function getSql(SqlWalker $sqlWalker) { return sprintf('12756 * ASIN(SQRT(POWER(SIN(((SELECT `lat` FROM `craue_geo_postalcode` WHERE `country` = %s AND `postal_code` = %s) - (SELECT `lat` FROM `craue_geo_postalcode` WHERE `country` = %s AND `postal_code` = %s)) * PI()/360), 2) + COS((SELECT `lat` FROM `craue_geo_postalcode` WHERE `country` = %s AND `postal_code` = %s) * PI()/180) * COS((SELECT `lat` FROM `craue_geo_postalcode` WHERE `country` = %s AND `postal_code` = %s) * PI()/180) * POWER(SIN(((SELECT `lng` FROM `craue_geo_postalcode` WHERE `country` = %s AND `postal_code` = %s) - (SELECT `lng` FROM `craue_geo_postalcode` WHERE `country` = %s AND `postal_code` = %s)) * PI()/360), 2)))', $sqlWalker->walkStringPrimary($this->countryOrigin), $sqlWalker->walkStringPrimary($this->postalCodeOrigin), $sqlWalker->walkStringPrimary($this->countryDestination), $sqlWalker->walkStringPrimary($this->postalCodeDestination), $sqlWalker->walkStringPrimary($this->countryOrigin), $sqlWalker->walkStringPrimary($this->postalCodeOrigin), $sqlWalker->walkStringPrimary($this->countryDestination), $sqlWalker->walkStringPrimary($this->postalCodeDestination), $sqlWalker->walkStringPrimary($this->countryOrigin), $sqlWalker->walkStringPrimary($this->postalCodeOrigin), $sqlWalker->walkStringPrimary($this->countryDestination), $sqlWalker->walkStringPrimary($this->postalCodeDestination)); }
/** * @override */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { $platform = $sqlWalker->getConnection()->getDatabasePlatform(); return $platform->getConcatExpression($sqlWalker->walkStringPrimary($this->firstStringPrimary), $sqlWalker->walkStringPrimary($this->secondStringPrimary)); }
/** * @override */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { //TODO: Use platform to get SQL return 'LOWER(' . $sqlWalker->walkStringPrimary($this->_stringPrimary) . ')'; }
/** * @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) : '') . ')'; }
public function getSql(SqlWalker $sqlWalker) { return 'DATE_FORMAT (' . $sqlWalker->walkArithmeticExpression($this->dateExpression) . ',' . $sqlWalker->walkStringPrimary($this->formatChar) . ')'; }
public function getSql(SqlWalker $sqlWalker) { $parts = array($sqlWalker->walkArithmeticPrimary($this->dateExpression), $sqlWalker->walkStringPrimary($this->dateFormat)); return sprintf('DATE_FORMAT(%s)', implode(', ', $parts)); }
/** * {@inheritdoc} */ public function getSql(SqlWalker $sqlWalker) { return sprintf('CONVERT_TZ(%s, %s, %s)', $sqlWalker->walkArithmeticExpression($this->dateExpression), $sqlWalker->walkStringPrimary($this->fromTz), $sqlWalker->walkStringPrimary($this->toTz)); }
/** * getSql - allows ORM to inject a DATE_FORMAT() statement into an SQL * string being constructed * * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker * @return void */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { return 'DATE_FORMAT(' . $sqlWalker->walkArithmeticExpression($this->_sDateExpression) . ',' . $sqlWalker->walkStringPrimary($this->_sFormatChar) . ')'; }
public function getSql(SqlWalker $sqlWalker) { $parts = array($sqlWalker->walkArithmeticPrimary($this->dateExpression), $sqlWalker->walkStringPrimary($this->fromTZ), $sqlWalker->walkStringPrimary($this->toTZ)); return sprintf('CONVERT_TZ(%s)', implode(', ', $parts)); }
/** * @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; }
/** * getSql - allows ORM to inject a DATE_FORMAT() statement into an SQL string being constructed * * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker * * @return void */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { $date = $sqlWalker->walkArithmeticExpression($this->dateExpression); $format = $sqlWalker->walkStringPrimary($this->formatChar); return sprintf('DATE_FORMAT(%s, %s)', $date, $format); }