diff --git a/Doctrine/DataDict.php b/Doctrine/DataDict.php index 5bb1fcacb..89633dd2d 100644 --- a/Doctrine/DataDict.php +++ b/Doctrine/DataDict.php @@ -134,7 +134,7 @@ class Doctrine_DataDict { */ public static function isValidClassname($classname) { if(preg_match('~(^[a-z])|(_[a-z])|([\W])|(_{2})~', $classname)) - throw new Doctrine_Exception("Class name is not valid. use camel case and underscores (i.e My_PerfectClass)."); + throw new Doctrine_Exception("Class name is not valid. Use camel case and underscores (i.e My_PerfectClass)."); return true; } } diff --git a/Doctrine/Table.php b/Doctrine/Table.php index 0c4263788..a053891d4 100644 --- a/Doctrine/Table.php +++ b/Doctrine/Table.php @@ -205,9 +205,11 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable { } endswitch; - if(Doctrine_DataDict::isValidClassname($class->getName()) && $this->getAttribute(Doctrine::ATTR_CREATE_TABLES)) { - $dict = new Doctrine_DataDict($this->getConnection()->getDBH()); - $dict->createTable($this->tableName, $this->columns); + if($this->getAttribute(Doctrine::ATTR_CREATE_TABLES)) { + if(Doctrine_DataDict::isValidClassname($class->getName())) { + $dict = new Doctrine_DataDict($this->getConnection()->getDBH()); + $dict->createTable($this->tableName, $this->columns); + } } }