Commit c134ad16 authored by zYne's avatar zYne

Added support for new attributes

parent a27ed3d3
...@@ -116,7 +116,25 @@ abstract class Doctrine_Configurable { ...@@ -116,7 +116,25 @@ abstract class Doctrine_Configurable {
case Doctrine::ATTR_AUTO_LENGTH_VLD: case Doctrine::ATTR_AUTO_LENGTH_VLD:
case Doctrine::ATTR_AUTO_TYPE_VLD: case Doctrine::ATTR_AUTO_TYPE_VLD:
case Doctrine::ATTR_QUERY_LIMIT: case Doctrine::ATTR_QUERY_LIMIT:
case Doctrine::ATTR_QUOTE_IDENTIFIER:
case Doctrine::ATTR_PORTABILITY:
break;
case Doctrine::ATTR_SEQCOL_NAME:
if( ! is_string($value))
throw new Doctrine_Exception('Sequence column name attribute only accepts string values');
break;
case Doctrine::ATTR_FIELD_CASE:
if($value != 0 && $value != CASE_LOWER && $value != CASE_UPPER)
throw new Doctrine_Exception('Field case attribute should be either 0, CASE_LOWER or CASE_UPPER constant.');
break;
case Doctrine::ATTR_SEQNAME_FORMAT:
case Doctrine::ATTR_IDXNAME_FORMAT:
if($this instanceof Doctrine_Table) {
throw new Doctrine_Exception('Sequence / index name format attributes cannot be set'
. 'at table level (only at connection or global level).');
}
break; break;
default: default:
throw new Doctrine_Exception("Unknown attribute."); throw new Doctrine_Exception("Unknown attribute.");
......
...@@ -97,6 +97,11 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera ...@@ -97,6 +97,11 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
Doctrine::ATTR_AUTO_TYPE_VLD => true, Doctrine::ATTR_AUTO_TYPE_VLD => true,
Doctrine::ATTR_CREATE_TABLES => true, Doctrine::ATTR_CREATE_TABLES => true,
Doctrine::ATTR_QUERY_LIMIT => Doctrine::LIMIT_RECORDS, Doctrine::ATTR_QUERY_LIMIT => Doctrine::LIMIT_RECORDS,
Doctrine::ATTR_IDXNAME_FORMAT => '%_idx',
Doctrine::ATTR_SEQNAME_FORMAT => '%_seq',
Doctrine::ATTR_QUOTE_IDENTIFIER => false,
Doctrine::ATTR_SEQCOL_NAME => 'id',
Doctrine::ATTR_PORTABILITY => Doctrine::PORTABILITY_ALL,
); );
foreach($attributes as $attribute => $value) { foreach($attributes as $attribute => $value) {
$old = $this->getAttribute($attribute); $old = $this->getAttribute($attribute);
...@@ -186,6 +191,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera ...@@ -186,6 +191,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
case "informix": case "informix":
$this->connections[$name] = new Doctrine_Connection_Informix($this, $adapter); $this->connections[$name] = new Doctrine_Connection_Informix($this, $adapter);
break; break;
default:
throw new Doctrine_Manager_Exception('Unknown connection driver '. $adapter->getAttribute(PDO::ATTR_DRIVER_NAME));
endswitch; endswitch;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment