From c6f5546fdd81a3c7362f41148bc23c8e2f73951a Mon Sep 17 00:00:00 2001 From: zYne Date: Mon, 27 Nov 2006 22:48:49 +0000 Subject: [PATCH] updated oracle driver --- lib/Doctrine/DataDict/Oracle.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/Doctrine/DataDict/Oracle.php b/lib/Doctrine/DataDict/Oracle.php index 02527169f..73ee5677c 100644 --- a/lib/Doctrine/DataDict/Oracle.php +++ b/lib/Doctrine/DataDict/Oracle.php @@ -27,7 +27,7 @@ * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_DataDict_Oracle extends Doctrine_DataDict { +class Doctrine_DataDict_Oracle extends Doctrine_Connection_Module { /** * Obtain DBMS specific SQL code portion needed to declare an text type * field to be used in statements like CREATE TABLE. @@ -50,15 +50,19 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict { * @return string DBMS specific SQL code portion that should be used to * declare the specified field. */ - public function getTypeDeclaration(array $field) { + public function getNativeDeclaration(array $field) { switch ($field['type']) { case 'string': case 'array': case 'object': case 'gzip': + case 'char': + case 'varchar': $length = !empty($field['length']) - ? $field['length'] : $db->options['default_text_field_length']; - $fixed = !empty($field['fixed']) ? $field['fixed'] : false; + ? $field['length'] : 16777215; // TODO: $db->options['default_text_field_length']; + + $fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; + return $fixed ? 'CHAR('.$length.')' : 'VARCHAR2('.$length.')'; case 'clob': return 'CLOB'; @@ -86,10 +90,9 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict { * * @param array $field native field description * @return array containing the various possible types, length, sign, fixed - * @author Lukas Smith (PEAR MDB2 library) * @throws Doctrine_DataDict_Oracle_Exception */ - public function mapNativeDatatype(array $field) { + public function getPortableDeclaration(array $field) { $db_type = strtolower($field['type']); $type = array(); $length = $unsigned = $fixed = null;