/** * @todo make it better * @param \RBM\SqlQuery\Func $func * @return string */ protected function _renderFunc(Func $func) { $name = $func->getName(); $format = "{$name}(%s)"; $args = $func->getArgs(); array_walk($args, function (&$arg) { $arg = $this->_renderValue($arg); }); return sprintf($format, implode(', ', $args)); }
/** * Override in order to get the string concatenation right * @param Func $func * @return string */ protected function _renderFunc(Func $func) { if ($func->getName() != 'CONCAT') { return parent::_renderFunc($func); } $args = $func->getArgs(); array_walk($args, function (&$arg) { $arg = $this->_renderValue($arg); }); return implode(' + ', $args); }