1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Added exception throwing for unknown data types,

deprecated short data type names 's', 'i' etc.
This commit is contained in:
doctrine 2006-08-08 20:31:45 +00:00
parent dc92af1442
commit 3a7f9b0e92
2 changed files with 6 additions and 14 deletions

View File

@ -5,7 +5,7 @@ class Doctrine_DataDict {
public function __construct(PDO $dbh) {
$file = Doctrine::getPath().DIRECTORY_SEPARATOR."Doctrine".DIRECTORY_SEPARATOR."adodb-hack".DIRECTORY_SEPARATOR."adodb.inc.php";
if( ! file_exists($file))
throw new Doctrine_Exception("Couldn't include datadict. File $file does not exist");
@ -59,11 +59,8 @@ class Doctrine_DataDict {
public function getADOType($type,$length) {
switch($type):
case "array":
case "a":
case "object":
case "o":
case "string":
case "s":
if($length <= 255)
return "C($length)";
elseif($length <= 4000)
@ -79,28 +76,21 @@ class Doctrine_DataDict {
case "clob":
return "XL";
break;
case "d":
case "date":
return "D";
break;
case "float":
case "f":
case "double":
return "F";
break;
case "timestamp":
case "t":
return "T";
break;
case "boolean":
case "bool":
return "L";
break;
case "enum":
case "e":
case "enum":
case "integer":
case "int":
case "i":
if(empty($length))
return "I8";
elseif($length < 4)
@ -115,6 +105,8 @@ class Doctrine_DataDict {
throw new Doctrine_Exception("Too long integer (max length is 20).");
break;
default:
throw new Doctrine_Exception("Unknown column type $type");
endswitch;
}
}

View File

@ -21,7 +21,7 @@
/**
* Doctrine_Tree_PathModel
*
* the purpose of Doctrine_Tree_NestedSet is to provide PathModel tree access
* the purpose of Doctrine_Tree_PathModel is to provide PathModel tree access
* strategy for all records extending it
*
* @package Doctrine ORM
@ -34,7 +34,7 @@ class Doctrine_Tree_PathModel extends Doctrine_Record {
public function getPath() { }
public function getDepth() { }
public function getDepth() { }
public function removeNode() { }