diff --git a/lib/Doctrine/Table.php b/lib/Doctrine/Table.php index 88daba505..0aa463bb8 100644 --- a/lib/Doctrine/Table.php +++ b/lib/Doctrine/Table.php @@ -335,7 +335,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable { * @param mixed $options * @return void */ - final public function setColumn($name, $type, $length, $options = array()) { + final public function setColumn($name, $type, $length = null, $options = array()) { if(is_string($options)) $options = explode('|', $options); @@ -348,7 +348,11 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable { } } $name = strtolower($name); - $this->columns[$name] = array($type,$length,$options); + + if($length == null) + $length = 2147483647; + + $this->columns[$name] = array($type, $length, $options); if(isset($options['primary'])) { $this->primaryKeys[] = $name; @@ -1009,10 +1013,10 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable { */ public function invokeSet(Doctrine_Record $record, $name, $value) { if( ! ($this->getAttribute(Doctrine::ATTR_ACCESSORS) & Doctrine::ACCESSOR_SET)) - return $value; - - $prefix = $this->getAttribute(Doctrine::ATTR_ACCESSOR_PREFIX_SET); - if (!$prefix) + return $value; + + $prefix = $this->getAttribute(Doctrine::ATTR_ACCESSOR_PREFIX_SET); + if (!$prefix) $prefix = 'set'; $method = $prefix . $name; @@ -1032,10 +1036,10 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable { if( ! ($this->getAttribute(Doctrine::ATTR_ACCESSORS) & Doctrine::ACCESSOR_GET)) return $value; - $prefix = $this->getAttribute(Doctrine::ATTR_ACCESSOR_PREFIX_GET); - if (!$prefix) + $prefix = $this->getAttribute(Doctrine::ATTR_ACCESSOR_PREFIX_GET); + if (!$prefix) $prefix = 'get'; - + $method = $prefix . $name; if(method_exists($record, $method)) {