1
0
mirror of synced 2024-12-13 22:56:04 +03:00

Added PostgreSQLs to_char() function to Expression/Pgsql.php.

This commit is contained in:
lukenukem 2007-09-27 18:25:58 +00:00
parent 4cd00271df
commit ca50bb05c5

View File

@ -120,6 +120,23 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression_Driver
} }
/**
* PostgreSQLs TO_CHAR( <time>, <text> ) function.
*
* @param string $time timestamp or interval
* @param string $text how to the format the output
* @return string
*/
public function to_char($time, $text) {
return 'TO_CHAR(' . $time . ', ' . $text . ')';
}
/**
* PostgreSQLs CONCAT() function
*
* @param an array of values
* @return string
*/
public function concat() public function concat()
{ {
$args = func_get_args(); $args = func_get_args();
@ -135,6 +152,7 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression_Driver
{ {
return 'LOCALTIMESTAMP(0)'; return 'LOCALTIMESTAMP(0)';
} }
/** /**
* regexp * regexp
* *
@ -144,6 +162,7 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression_Driver
{ {
return 'SIMILAR TO'; return 'SIMILAR TO';
} }
/** /**
* return string to call a function to get random value inside an SQL statement * return string to call a function to get random value inside an SQL statement
* *