From d1c45859c6ea853e047e05f83db027301117f0e7 Mon Sep 17 00:00:00 2001 From: chtito Date: Sat, 20 Jan 2007 11:44:41 +0000 Subject: [PATCH] added a setDateFormat method (primarily intended for the Oracle connection) --- lib/Doctrine/Connection.php | 10 ++++++++++ lib/Doctrine/Connection/Oracle.php | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/lib/Doctrine/Connection.php b/lib/Doctrine/Connection.php index 103d71f5b..0ad491458 100644 --- a/lib/Doctrine/Connection.php +++ b/lib/Doctrine/Connection.php @@ -480,6 +480,16 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun public function setCharset($charset) { } + /** + * Set the date/time format for the current connection + * + * @param string time format + * + * @return void + */ + public function setDateFormat($format = null) + { + } /** * fetchAll * diff --git a/lib/Doctrine/Connection/Oracle.php b/lib/Doctrine/Connection/Oracle.php index 7532b2f8f..61fcfa7b2 100644 --- a/lib/Doctrine/Connection/Oracle.php +++ b/lib/Doctrine/Connection/Oracle.php @@ -69,6 +69,14 @@ class Doctrine_Connection_Oracle extends Doctrine_Connection $this->options['result_prefetching'] = false; */ parent::__construct($manager, $adapter); + } + /** + * Sets up the date/time format + * + */ + public function setDateFormat($format = 'YYYY-MM-DD HH24:MI:SS') + { + $this->exec('ALTER SESSION NLS_DATE_FORMAT "'.$format.'";'); } /** * Adds an driver-specific LIMIT clause to the query