diff --git a/lib/Doctrine/Expression/Driver.php b/lib/Doctrine/Expression/Driver.php index 8aa175e36..591c61775 100644 --- a/lib/Doctrine/Expression/Driver.php +++ b/lib/Doctrine/Expression/Driver.php @@ -299,15 +299,16 @@ class Doctrine_Expression_Driver extends Doctrine_Connection_Module * Returns a series of strings concatinated * * concat() accepts an arbitrary number of parameters. Each parameter - * must contain an expression or an array with expressions. + * must contain an expression * - * @param string|array(string) strings that will be concatinated. + * @param string $arg1, $arg2 ... $argN strings that will be concatinated. + * @return string */ public function concat() { $args = func_get_args(); - return 'CONCAT(' . join(', ', (array) $args) . ')'; + return join(' || ' , $args); } /** @@ -717,7 +718,7 @@ class Doctrine_Expression_Driver extends Doctrine_Connection_Module /** * sin * - * @param string $value + * @param string $value * @return void */ public function sin($value) @@ -738,7 +739,7 @@ class Doctrine_Expression_Driver extends Doctrine_Connection_Module /** * cos * - * @param string $value + * @param string $value * @return void * @author Jonathan H. Wage */ @@ -752,11 +753,11 @@ class Doctrine_Expression_Driver extends Doctrine_Connection_Module * * for all native RDBMS functions the function name itself is returned */ - public function __call($m, $a) + public function __call($m, $a) { if ($this->conn->getAttribute(Doctrine::ATTR_PORTABILITY) & Doctrine::PORTABILITY_EXPR) { throw new Doctrine_Expression_Exception('Unknown expression ' . $m); } return $m . '(' . implode(', ', $a) . ')'; } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Expression/Mysql.php b/lib/Doctrine/Expression/Mysql.php index 0f26b2057..bf9bb8afe 100644 --- a/lib/Doctrine/Expression/Mysql.php +++ b/lib/Doctrine/Expression/Mysql.php @@ -112,16 +112,17 @@ class Doctrine_Expression_Mysql extends Doctrine_Expression_Driver } /** - * Returns string to concatenate two or more string parameters + * Returns a series of strings concatinated * - * @param string $value1 - * @param string $value2 - * @param string $values... - * @return string to concatenate two strings - **/ - function concat($value1, $value2) + * concat() accepts an arbitrary number of parameters. Each parameter + * must contain an expression or an array with expressions. + * + * @param string|array(string) strings that will be concatinated. + */ + public function concat() { $args = func_get_args(); - return 'CONCAT('.implode(', ', $args).')'; + + return 'CONCAT(' . join(', ', (array) $args) . ')'; } } diff --git a/lib/Doctrine/Expression/Oracle.php b/lib/Doctrine/Expression/Oracle.php index 4cd1c6ff5..34518275a 100644 --- a/lib/Doctrine/Expression/Oracle.php +++ b/lib/Doctrine/Expression/Oracle.php @@ -32,22 +32,6 @@ Doctrine::autoload('Doctrine_Expression_Driver'); */ class Doctrine_Expression_Oracle extends Doctrine_Expression_Driver { - /** - * Returns a series of strings concatinated - * - * concat() accepts an arbitrary number of parameters. Each parameter - * must contain an expression - * - * @param string $arg1, $arg2 ... $argN strings that will be concatinated. - * @return string - */ - public function concat() - { - $args = func_get_args(); - - return join(' || ' , $args); - } - /** * return string to call a function to get a substring inside an SQL statement * @@ -105,4 +89,4 @@ class Doctrine_Expression_Oracle extends Doctrine_Expression_Driver { return 'SYS_GUID()'; } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Expression/Pgsql.php b/lib/Doctrine/Expression/Pgsql.php index 2451906b5..93400e8c2 100644 --- a/lib/Doctrine/Expression/Pgsql.php +++ b/lib/Doctrine/Expression/Pgsql.php @@ -83,17 +83,6 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression_Driver } } - /** - * Returns a series of strings concatinated - * - * concat() accepts an arbitrary number of parameters. Each parameter - * must contain an expression or an array with expressions. - * - * @param string|array(string) strings that will be concatinated. - * @return string - */ - - /** * PostgreSQLs AGE( [, ]) function. * @@ -131,19 +120,6 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression_Driver return 'TO_CHAR(' . $time . ', ' . $text . ')'; } - /** - * PostgreSQLs CONCAT() function - * - * @param an array of values - * @return string - */ - public function concat() - { - $args = func_get_args(); - - return join(' || ' , $args); - } - /** * Returns the SQL string to return the current system date and time. * @@ -223,4 +199,4 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression_Driver $match.= $this->patternEscapeString(); return $match; } -} \ No newline at end of file +}