From 1da5baee10bf73d8c623ffe91f4c2b8143bf71fb Mon Sep 17 00:00:00 2001 From: zYne Date: Fri, 2 Mar 2007 20:47:17 +0000 Subject: [PATCH] --- lib/Doctrine.php | 4 ++-- lib/Doctrine/Configurable.php | 1 + lib/Doctrine/Hook/Parser.php | 7 ++++++- lib/Doctrine/Table.php | 8 ++++++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/Doctrine.php b/lib/Doctrine.php index 588c9ff79..e28493709 100644 --- a/lib/Doctrine.php +++ b/lib/Doctrine.php @@ -150,11 +150,11 @@ final class Doctrine const ATTR_FIELD_CASE = 102; const ATTR_IDXNAME_FORMAT = 103; const ATTR_SEQNAME_FORMAT = 104; + const ATTR_SEQCOL_NAME = 105; const ATTR_CMPNAME_FORMAT = 118; const ATTR_DBNAME_FORMAT = 117; const ATTR_TBLCLASS_FORMAT = 119; const ATTR_EXPORT = 140; - const ATTR_SEQCOL_NAME = 105; @@ -169,7 +169,7 @@ final class Doctrine const ATTR_DEF_VARCHAR_LENGTH = 114; const ATTR_DEF_TABLESPACE = 115; const ATTR_EMULATE_DATABASE = 116; - + const ATTR_DEFAULT_SEQUENCE = 133; /** TODO: REMOVE THE FOLLOWING CONSTANTS AND UPDATE THE DOCS ! */ diff --git a/lib/Doctrine/Configurable.php b/lib/Doctrine/Configurable.php index c74e3fb54..437e006d6 100644 --- a/lib/Doctrine/Configurable.php +++ b/lib/Doctrine/Configurable.php @@ -127,6 +127,7 @@ abstract class Doctrine_Configurable case Doctrine::ATTR_ACCESSOR_PREFIX_GET: case Doctrine::ATTR_ACCESSOR_PREFIX_SET: case Doctrine::ATTR_EMULATE_DATABASE: + case Doctrine::ATTR_DEFAULT_SEQUENCE: break; case Doctrine::ATTR_SEQCOL_NAME: diff --git a/lib/Doctrine/Hook/Parser.php b/lib/Doctrine/Hook/Parser.php index c0aef56f4..fd55d77c4 100644 --- a/lib/Doctrine/Hook/Parser.php +++ b/lib/Doctrine/Hook/Parser.php @@ -39,7 +39,12 @@ abstract class Doctrine_Hook_Parser { return $this->condition; } - + /** + * getParams + * returns the parameters associated with this parser + * + * @return array + */ public function getParams() { return $this->params; diff --git a/lib/Doctrine/Table.php b/lib/Doctrine/Table.php index 29b206edf..d6106e87d 100644 --- a/lib/Doctrine/Table.php +++ b/lib/Doctrine/Table.php @@ -266,10 +266,14 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable $this->identifierType = Doctrine_Identifier::SEQUENCE; $found = true; - if($value) { + if ($value) { $this->options['sequenceName'] = $value; } else { - $this->options['sequenceName'] = $this->conn->getSequenceName($this->options['tableName']); + if (($sequence = $this->getAttribute(Doctrine::ATTR_DEFAULT_SEQUENCE)) !== null) { + $this->options['sequenceName'] = $sequence; + } else { + $this->options['sequenceName'] = $this->conn->getSequenceName($this->options['tableName']); + } } break; }