Commit ca50bb05 authored by lukenukem's avatar lukenukem

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

parent 4cd00271
...@@ -120,6 +120,23 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression_Driver ...@@ -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 ...@@ -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 ...@@ -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
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment